Microsoft PowerPoint - lecture11-ch4.ppt

Size: px
Start display at page:

Download "Microsoft PowerPoint - lecture11-ch4.ppt"

Transcription

1 Geometric Objects and Transformation 년봄학기 4/17/2007 박경신 OpenGL Transformation OpenGL 은기본적인변환을수행하는함수를제공한다. Translation: 이동변환은 3 차원이동변위벡터 (dx, dy, dz) 를넣는다. Rotation: 회전변환은 axis( 회전축 ) 와 angle( 각도 ) 을넣는다. Scaling: 크기변환은 scaling factor ( 크기변환값 ) 를넣는다. 이각각의함수는 4x4 변환행렬을생성하여객체에적용이된다. OpenGL Transformation gltranslate*(dx, dy, dz) 이동변환인자 dx, dy, dz 는실수 2 차원이동 : dz = 0.0 gltranslatef(25.0, -10.0, 0.0); glrotate* (theta, vx, vy, vz) 회전변환인자 theta 는회전량각도 (rotation angle in degrees) 는 0~360 사이의값을가짐 벡터 (vx, vy, vz) 는회전축 (rotation axis) glrotatef(90, 0, 0, 1); glscale*(sx, sy, sz) 크기변환인자 sx, sy, sz 는실수 반사 (reflection) 는인자값에음수를적용 glscalef(2.0, -3.0, 1.0); Suffix code (*) 는 f (float) 또는 d (double) Translation in OpenGL gltranslatef(x, y, z) 객체를 (x, y, z) 만큼이동 2차원 gltranslate 함수는없다. Example: gltranslatef(0.5, -0.2, 0.0); glbegin(gl_triangles); glvertex2f(0.0, 0.0); glvertex2f(0.5, 0.0); glvertex2f(0.25, 0.5); glend();

2 Rotation in OpenGL glrotatef(angle, x, y, z) 임의의축 axis (x,y,z) 에대해각도 angle 만큼회전 2 차원회전은 z- 축 (0, 0, 1) 로사용한다. Example: glrotatef(90.0, 0.0, 0.0, 1.0); glbegin(gl_triangles); glvertex2f(0.5, 0.0); glvertex2f(0.8, 0.0); glvertex2f(0.65, 0.5); glend(); Scale in OpenGL glscalef(x, y, z) x-축으로 x만큼, y-축으로 y만큼, z-축으로 z만큼크기를변환 이때, scale factor>1 이면커지고, 0<scale factor<=1 이면작아지고, scale factor<0 면반사 (reflection) 된다. 2 차원크기변환은 z 에 1 을넣는다. Example: glscalef(0.25, 0.5, 1.0); glbegin(gl_triangles); glvertex2f(0.5, 0.0); glvertex2f(0.8, 0.0); glvertex2f(0.65, 0.5); glend(); Transformation Order OpenGL 에서모델링변환행렬들은객체에설정된반대순서로적용된다. 즉, 마지막변환 ( 즉, 기하함수호출바로전에쓰인것 ) 이정점데이터에먼저적용된다. gltranslatef(0.5, 0, 0); glrotatef(45, 0, 0, 1); drawtriangle(); M=T*R p =Mp Transformation Order glcolor3f(1.0, 0.0, 1.0); glutwirecube(1); glrotatef(45.0, 0.0, 0.0, 1.0); gltranslatef(1.5, 0.0, 0.0); glcolor3f(1.0, 0.0, 0.0); glutwirecube(1); glrotatef(45, 0, 0, 1); gltranslatef(0.5, 0, 0); drawtriangle(); M=R*T p = Mp gltranslatef(1.5, 0.0, 0.0); glrotatef(45.0, 0.0, 0.0, 1.0); glcolor3f(0.0, 1.0, 0.0); glutwirecube(1);

3 glmatrixmode(glenum mode) glmatrixmode 는행렬모드를설정한다. 현재의행렬이모델뷰 (model view), 투영 (projection), 텍스쳐 (texture) 행렬중어떤것인지를나타내는함수이다. glmatrixmode(gl_projection) 연속되는행렬연산을투영행렬 (projection matrix) 스택에적용한다. 투영행렬은 3D 공간에카메라설정을수학적으로표현한행렬이다. glmatrixmode(gl_model_view) 연속되는행렬연산을기하변환행렬 (geometric transformation matrix) 스택에적용한다. 3D 공간에물체의배치를수학적으로표현한행렬이다. 현재 modelview 모드에있으면, 모델링변환함수 ( 즉, 이동, 회전, 크기변환함수 ) 의행렬을기하변환행렬스택에적용한다. glloadidentity() 현재의행렬을 4x4 단위행렬 (identity matrix) 로설정한다. 즉, 현재의행렬을초기화한다. glloadmatrixd/f(const GLdouble/GLfloat *M) 현재행렬에임의의변환행렬 16 개의값 M 을대입한다. 이때, M 의 element 는열 - 중심 (column-major) 순서로지정해야한다. M= m 0 m 4 m 8 m 12 v 0 m 1 m 5 m 9 m 13 v 1 m 2 m 6 m 10 m 14 v 2 m 3 m 7 m 11 m 15 v 3 glmatrixmode(gl_modelview); GLfloat M[16]; GLint k; for (k=0; k<16; k++) elements[k] = float(k); glloadmatrixf(m); M = glmultmatrixd/f(const GLdouble/GLfloat *M) 현재의행렬에 M을곱한다. 이때, M 의 16 개의값을가지고있고, 각 element 는열 - 중심 (columnmajor) 순서로지정해야한다. 현재의행렬은 glmultmatrix 에서지정한행렬에의해 postmultipy 된후값이바뀐다. // 물체를공간상에그리기위해행렬모드를 GL_MODELVIEW로설정 glmatrixmode(gl_modelview); glloadidentity(); // 행렬을초기화 glmultmatrixf(m2); // M2행렬을곱함 glmultmatrixf(m1); // M1행렬을곱함

4 glgetfloatv(gl_modelview_matrix, M) 현재의변환행렬을 M 으로돌려준다. GLfloat M[16]; glgetfloatv(gl_modelview, M); C I C C T C C S C C R C M glloadidentity(); gltranslatef(dx, dy, dz); glscalef(sx, sy, sz); glrotatef(angle, ax, ay, az); glloadmatrixf(ptr_to_matrix); glpushmatrix() & glpopmatrix() 행렬스택에 glpushmatrix() 는현재상태를저장하고 glpopmatrix() 는스택의맨위에저장된상태로복원시킨다. glmatrixmode(gl_modelview); glloadidentity(); gltranslatef(2.0, 1.0, 0.0); glrotatef(60, 1.0, 0.0, 0.0); gltranslatef(-2.0, 1.0, 0.0); drawobject(); // C = I // C = T (p) // C = C R (θ) = T(p) R(θ) // C = C T(-p) = T(p) R(θ) T(-p) Hierarchical Transformations 계층적변환 (hierarchical transformation) 은한변환을다른변환에소속시키는것으로생각하면된다. 계층적변환이란한객체의변환을다른객체들에상대적인변환으로사용된다. 2 개의자동차바퀴 (wheel) 가자동차차체 (body) 에상대적인계층적변환의예를보자면 : Apply body transformation Draw body Save state Apply front wheel transformation Draw wheel Restore saved state Apply rear wheel transformation Draw wheel Hierarchical Transformations 또한, 이자동차가움직이게되면, 자동차의차체에서상대적인위치에있는바퀴두개도역시몸체와같이움직이게됨을알수있다. 이때, 두개의바퀴를자동차의몸체의변환에같이영향을받도록만들어하며, 바퀴가각자따로변환하지않도록한다.

5 Example: Car glloadidentity(); glcolor3f(0.0, 0.0, 1.0); gltranslatef(carpos[0], carpos[1], carpos[2]); drawbody(); glcolor3f(1.0, 1.0, 0.0); gltranslatef(-0.2, 0.0, 0.0); glrotatef(angle, 0, 0, 1); drawwheel(); Transformation Hierarchy 계층적변환 (hierarchical transformations) 은종종변환의트리 (tree) 구조로표현한다. 3 차원캐릭터를디자인하기위해강체부분 (rigid body parts) 으로만들어진계층적변환구조를사용한다. 그리고, 보다유연한 3 차원캐릭터디자인을위해서는다수의계층적변환을적절히섞어사용해야한다. 이런계층은장면그라프 (scene graph) 의기초와동일하다. glcolor3f(1.0, 0.0, 0.0); gltranslatef(0.2, 0.0, 0.0); glrotatef(angle, 0, 0, 1); drawwheel(); Example: Robot Example: Solar Display() glrotatef (theta, 0.0, 1.0, 0.0); Base(); gltranslatef (0.0, h1, 0.0); glrotatef(phi, 0.0, 0.0, 1.0); DrawLowerArm (); LowerArm UpperArm // global variables float g_elpasedtime; double g_currenttime, g_previoustime; float g_sunradius = 5.0f; float g_earthradius = 1.0f; float g_moonradius = 0.5f; float g_earthdistancefromsun = -12.0f; float g_moondistancefromearth = -2.0f; gltranslatef (0.0, h2, 0.0); glrotatef (psi, 0.0, 0.0, 1.0); DrawUpperArm(); Base void update() g_currenttime = timegettime(); g_elpasedtime = (float)((g_currenttime - g_previoustime) * 0.001); g_previoustime = g_currenttime; glutpostredisplay();

6 Example: Solar void display (void) static float SunSpin = 0.0f; static float EarthSpin = 0.0f; static float EarthOrbit = 0.0f; static float MoonSpin = 0.0f; static float MoonOrbit = 0.0f; if( g_orbiton == true ) SunSpin -= g_speed * (g_elpasedtime * 10.0f); EarthSpin -= g_speed * (g_elpasedtime * 100.0f); EarthOrbit -= g_speed * (g_elpasedtime * 20.0f); MoonSpin -= g_speed * (g_elpasedtime * 50.0f); MoonOrbit -= g_speed * (g_elpasedtime * 200.0f); Example: Solar // The Sun (spins by rotating it about y-axis) glrotatef( SunSpin, 0.0f, 1.0f, 0.0f ); // spin on its own axis. glcolor3f( 1.0f, 1.0f, 0.0f ); glutwiresphere( g_sunradius, 20, 20 ); // The Earth spins on its own axis and orbit the Sun. glrotatef( EarthOrbit, 0.0f, 1.0f, 0.0f ); gltranslatef( 0.0f, 0.0f, g_earthdistancefromsun ); glrotatef( EarthSpin, 0.0f, 1.0f, 0.0f ); glcolor3f( 0.0f, 1.0f, 0.0f ); glutwiresphere( g_earthradius, 10, 10 ); Example: Solar Example: Solar Using Matrix & Vector Class // The Moon spins on its own axis and orbit the Earth. glrotatef( EarthOrbit, 0.0f, 1.0f, 0.0f ); gltranslatef( 0.0f, 0.0f, g_earthdistancefromsun ); glrotatef( MoonOrbit, 0.0f, 1.0f, 0.0f ); gltranslatef( 0.0f, 0.0f, g_moondistancefromearth ); glrotatef( MoonSpin, 0.0f, 1.0f, 0.0f ); glcolor3f( 1.0f, 1.0f, 1.0f ); glutwiresphere( g_moonradius, 8, 8 ); glutswapbuffers(); #include matrix4x4.h #include vector3.h void display (void) // The Sun (spins by rotating it about y-axis) matrix4x4 msunspinrotation; matrix4x4 msunmatrix; msunspinrotation.rotate( SunSpin, 'y'); msunmatrix = msunspinrotation; // spin it on its axis. glmultmatrixf( msunmatrix.m ); glcolor4f( 1.0f, 1.0f, 0.0f, 1.0f ); glutwiresphere( g_sunradius, 20, 20 );

7 Example: Solar Using Matrix & Vector Class // The Earth spins on its own axis and orbit the Sun. matrix4x4 mearthtranslationtoorbit; matrix4x4 mearthspinrotation; matrix4x4 mearthorbitrotation; matrix4x4 mearthmatrix; mearthspinrotation.rotate( EarthSpin, 'y' ); mearthtranslationtoorbit.translate(vector3(0.0f, 0.0f, g_earthdistancefromsun)); mearthorbitrotation.rotate( EarthOrbit, 'y' ); mearthmatrix = mearthorbitrotation * mearthtranslationtoorbit * mearthspinrotation; glmultmatrixf( mearthmatrix.m ); glcolor4f( 0.0f, 1.0f, 0.0f, 1.0f ); glutwiresphere( g_earthradius, 10, 10 ); Example: Solar Using Matrix & Vector Class // The Moon spins on its own axis and orbit the Earth matrix4x4 mmoontranslationtoorbit; matrix4x4 mmoonspinrotation; matrix4x4 mmoonorbitrotation; matrix4x4 mmoonmatrix; mmoonspinrotation.rotate( MoonSpin, 'y' ); mmoontranslationtoorbit.translate( vector3(0.0f, 0.0f, g_moondistancefromearth) ); mmoonorbitrotation.rotate( MoonOrbit, 'y' ); mmoonmatrix = mearthorbitrotation * mearthtranslationtoorbit * mmoonorbitrotation * mmoontranslationtoorbit * mmoonspinrotation; glmultmatrixf( mmoonmatrix.m ); glcolor4f( 1.0f, 1.0f, 1.0f, 1.0f ); glutwiresphere( g_moonradius, 8, 8 ); glutswapbuffers(); 3D Geometry Functions GLUT shapes GLU quadrics Modeling a cube 3D Model Loading GLUT Shapes GLUT 는다양한기본도형드로잉함수를제공한다. 예를들어, platonic solids, simple curves, teapots 등등 GLUT 도형드로잉함수는 solid 나 wireframe 으로그릴수있다. glutsolidsphere(1.5, 16, 8) glutwiredodecahedron() 예제 glutshapes.cpp

8 GLUT Shapes glutsolidcube(size) glutsolidsphere(radius, slices, stacks) glutsolidcone(baseradius, height, slices, stacks) glutsolidtorus(innerradius, outerradius, sides, rings) glutsolidoctahedron() glutsoliddodecahedron() glutsolidicosahedron() glutsolidteapot(size) GLU Quadrics Quadrics 이란예를들어 x 2 + y 2 + z 2 = r 2 와같은다양한곡선이나표면을만들어내는함수이다. are various smooth surfaces described by functions like: 기본적인 GLU quadrics 는 spheres, cylinders, cone, disk 를포함하고있다. GLU quadrics 를그리려면 quadric object 을생성해서 GLU 함수에넘겨줘야한다. 그리고, GLU 에서는 quadrics 를 points, lines, 또는 polygons 등어떻게그릴지제어하는함수도제공하고있다. quadric = glunewquadric(); gluquadricdrawstyle(quadric, GLU_LINE); glusphere(quadric, 2.5, 32, 24); 예제 gluquadrics.cpp GLUT Quadrics glusphere(quadric, radius, slices, stacks) glucylinder(quadric, baseradius, topradius, height, slices, stacks) Cone using gluclinder(quadric, 0, topradius, height, slices, stacks) gludisk(quadric, innerradius, outerradius, slides, rings) glutpartialdisk(quadric, innerradius, outerradius, slides, rings, startangle, sweepangle) Modeling a Cube OpenGL 에서정점의 winding 순서 v 0, v 3, v 2, v 1 과 v 1, v 0, v 3, v 2 은같은다각형을만들어낸다. 그러나, 정점의 winding 순서 v 1, v 2, v 3, v 0 은다르다. OpenGL 에서는오른손좌표계를사용하므로, counterclockwise encirclement 로정점을정의했을때바깥쪽을향하는법선벡터 (normal) 을만들어낸다.

9 Modeling a Cube Modeling a Cube Vertex list 와 Index list 를사용하여 cube 를그린다. GLfloat vertex[][3] = -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0, 1.0,-1.0, -1.0, 1.0,-1.0, -1.0,-1.0, 1.0, 1.0,-1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0 ; GLfloat normal[][3] = 1.0, 0.0, 0.0, // right 0.0, 1.0, 0.0, // top 0.0, 0.0, 1.0, // front -1.0, 0.0, 0.0, // left 0.0, -1.0, 0.0, // bottom 0.0, 0.0, -1.0, // back ; (0, 0, 1) front void polygon(int n, int b, int c, int d) glbegin(gl_polygon); glnormalfv(normal[n]); glvertex3fv(vertex[a]); glvertex3fv(vertex[b]); glvertex3fv(vertex[c]); glvertex3fv(vertex[d]); glend(); void cube( ) polygon(0, 5, 1, 2, 6); // right polygon(1, 6, 2, 3, 7); // top polygon(2, 6, 7, 4, 5); // front polygon(3, 4, 7, 3, 0); // left polygon(4, 4, 0, 1, 5); // bottom polygon(5, 0, 3, 2, 1); // back (0, 0, 1) front Model Files Wavefront OBJ Files 3 차원모델종류 Wavefront (.obj) Inventor (.iv) VRML / X3D 3D Studio (.3ds) OpenFlight (.flt) 3 차원객체모델은아래와같은정보를포함하고있다. Geometry data vertex positions, faces Colors/material properties Textures Transformations OBJ file 은일반텍스트파일로, 정점 (vertices), 다각형표면 (polygon faces), 재질 (material) 등그외다수의정보를포함하고있다. 각 line 은정점, 법선벡터, 텍스쳐등어떤정보를가진 line 인지알려주는토큰 (token) 으로시작한다. v x y z Vertex position vn x y z Vertex normal vt u v texture coordinate f v1 v2 v3.. Face (list of vertex numbers) Mtllib file.mtl File containing material descriptions Usemtl name Current material to apply to geometry

Microsoft PowerPoint - lecture11-ch4

Microsoft PowerPoint - lecture11-ch4 Geometric Objects and Transformation 321190 2007 년봄학기 4/17/2007 박경신 OpenGL Transformation OpenGL 은기본적인변환을수행하는함수를제공한다. Translation: 이동변환은 3 차원이동변위벡터 (dx, dy, dz) 를넣는다. Rotation: 회전변환은 axis( 회전축 ) 와 angle(

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 03 모델변환과시점변환 01 기하변환 02 계층구조 Modeling 03 Camera 시점변환 기하변환 (Geometric Transformation) 1. 이동 (Translation) 2. 회전 (Rotation) 3. 크기조절 (Scale) 4. 전단 (Shear) 5. 복합변환 6. 반사변환 7. 구조변형변환 2 기하변환 (Geometric Transformation)

More information

Microsoft Word - cg07-midterm.doc

Microsoft Word - cg07-midterm.doc 중간고사 담당교수 : 단국대학교멀티미디어공학전공박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호를기입하면성적공고시학번대신암호를사용할것임. 1. 맞으면 true, 틀리면 false를적으시오.

More information

Microsoft PowerPoint - 13prac.pptx

Microsoft PowerPoint - 13prac.pptx Viewing 1 th Week, 29 OpenGL Viewing Functions glulookat() Defining a viewing matrix glortho() Creating a matrix for an orthographic parallel viewing i volume glfrustum() Creating a matrix for a perspective-view

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 01 OpenGL 과 Modeling 01 OpenGL API 02 Rendering Pipeline 03 Modeling 01 OpenGL API 1. OpenGL API 설치및환경설정 2. OpenGL API 구조 2 01 1. OpenGL API 설치및환경설정 OpenGL API 의상대적위치 System Memory Graphics Application

More information

Microsoft Word - cg07-final.doc

Microsoft Word - cg07-final.doc 기말고사 담당교수 : 단국대학교멀티미디어공학전공박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 성적공고시중간고사때제출한암호를사용할것임. 1. 맞으면 true, 틀리면 false를적으시오. (20점) 1) 은면제거알고리즘중페인터알고리즘

More information

Microsoft PowerPoint - lecture15-ch6.ppt

Microsoft PowerPoint - lecture15-ch6.ppt Lighting OpenGL Lighting OpenGL의조명에는 3가지요소가필요 광원 (Lights) 재질 (Materials) 면의법선벡터 (Normals) 321190 2008년봄학기 5/26/2007 박경신 OpenGL Lighting OpenGL Lighting OpenGL에서제공하는조명모델 환경광 / 주변광 (ambient lights) 점광원 (point

More information

04_오픈지엘API.key

04_오픈지엘API.key 4. API. API. API..,.. 1 ,, ISO/IEC JTC1/SC24, Working Group ISO " (Architecture) " (API, Application Program Interface) " (Metafile and Interface) " (Language Binding) " (Validation Testing and Registration)"

More information

단국대학교멀티미디어공학그래픽스프로그래밍중간고사 (2011 년봄학기 ) 2011 년 4 월 26 일학과학번이름 중간고사 담당교수 : 단국대학교멀티미디어공학전공박경신 l 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤

단국대학교멀티미디어공학그래픽스프로그래밍중간고사 (2011 년봄학기 ) 2011 년 4 월 26 일학과학번이름 중간고사 담당교수 : 단국대학교멀티미디어공학전공박경신 l 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤 중간고사 담당교수 : 단국대학교멀티미디어공학전공박경신 l 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. l 답안지에학과, 학번, 이름외에본인의암호를기입하면성적공고시학번대신암호를사용할것임. 1. 맞으면 true, 틀리면 false를적으시오.

More information

Microsoft Word - cg08-final-answer.doc

Microsoft Word - cg08-final-answer.doc 기말고사 담당교수 : 단국대학교멀티미디어공학전공박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 성적공고시중간고사때제출한암호를사용할것임. 1. 다음문제에답하시오. (50점) 1) 표면의법선벡터 (normal vector) N과표면에서광원으로향하는광원벡터

More information

Microsoft PowerPoint - lecture16-ch6

Microsoft PowerPoint - lecture16-ch6 Lighting OpenGL Lighting OpenGL의조명에는 3가지요소가필요 광원 (Lights) 재질 (Materials) 면의법선벡터 (Normals) 321190 2007년봄학기 5/15/2007 박경신 OpenGL Lighting OpenGL Lighting OpenGL에서제공하는조명모델 환경광 / 주변광 (ambient lights) 점광원 (point

More information

Microsoft Word - cg09-midterm.doc

Microsoft Word - cg09-midterm.doc 중간고사 담당교수 : 단국대학교멀티미디어공학전공박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호를기입하면성적공고시학번대신암호를사용할것임. 1. 맞으면 true, 틀리면 false를적으시오.

More information

Open GL

Open GL Graphics OpenGL 컴퓨터그래픽스연구실 GLUT 모델링 정 6 면체 void glutsolidcube(gldouble size); 물체겉면이칠해진형태 void glutwirecube(gldouble size); 물체뼈대만선으로표시 size : 정육면체모서리의길이 GLUT 모델링 원구 void glutsolidsphere(gldouble radius,

More information

Open GL

Open GL Graphics Basic Windows & OpenGL Programming 컴퓨터그래픽스연구실 OpenGL 관련참고사이트 OpenGL 공식사이트 http://www.opengl.org/ Khronos Group http://www.khronos.org/ Nehe Productions http://nehe.gamedev.net/ OpenGL 파일설정 압축을푼후다음경로로파일을복사

More information

서강대학교 공과대학 컴퓨터공학과 CSE4170 기초 컴퓨터 그래픽스 중간고사 (1/7) [CSE4170: 기초 컴퓨터 그래픽스] 중간고사 (담당교수: 임 인 성) 답은 연습지가 아니라 답안지에 기술할 것. 답 안지 공간이 부족할 경우, 답안지 뒷면에 기술 하고, 해당

서강대학교 공과대학 컴퓨터공학과 CSE4170 기초 컴퓨터 그래픽스 중간고사 (1/7) [CSE4170: 기초 컴퓨터 그래픽스] 중간고사 (담당교수: 임 인 성) 답은 연습지가 아니라 답안지에 기술할 것. 답 안지 공간이 부족할 경우, 답안지 뒷면에 기술 하고, 해당 (/7) [CSE47: 기초 컴퓨터 그래픽스] 중간고사 (담당교수: 임 인 성) 답은 연습지가 아니라 답안지에 기술할 것. 답 안지 공간이 부족할 경우, 답안지 뒷면에 기술 하고, 해당 답안지 칸에 그 사실을 명기할 것.. 2차원 아핀변환인 이동변환 T (t, t ), 크기변환 S(s, s ), 그리고 회전변환 R(θ)에 대한 3행 3열 행렬들을 고려하자.

More information

슬라이드 1

슬라이드 1 한국산업기술대학교 제 5 강스케일링및회전 이대현교수 학습안내 학습목표 3D 오브젝트의확대, 축소및회전방법을이해한다. 학습내용 3D 오브젝트의확대및축소 (Scaling) 3D 오브젝트의회전 (Rotation) 변홖공갂 (Transform Space) SceneNode 의크기변홖 (Scale) void setscale ( Real x, Real y, Real z)

More information

Microsoft Word - cg09-final-answer.doc

Microsoft Word - cg09-final-answer.doc 기말고사 담당교수 : 단국대학교멀티미디어공학전공박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 성적공고시중간고사때제출한암호를사용할것임. 1. 다음문제에답하시오. (50점) 1) 직교투영 (orthographic projection),

More information

단국대학교멀티미디어공학그래픽스프로그래밍기말고사 (2012 년봄학기 ) 2012 년 6 월 12 일학과학번이름 기말고사 담당교수 : 단국대학교멀티미디어공학전공박경신 l 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤

단국대학교멀티미디어공학그래픽스프로그래밍기말고사 (2012 년봄학기 ) 2012 년 6 월 12 일학과학번이름 기말고사 담당교수 : 단국대학교멀티미디어공학전공박경신 l 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤 기말고사 담당교수 : 단국대학교멀티미디어공학전공박경신 l 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. l 답안지에학과, 학번, 이름외에본인의암호를기입하면성적공고시학번대신암호를사용할것임. 1. 다음은 oglclass 에서제공하는

More information

Microsoft PowerPoint - 06-Body Data Class.pptx

Microsoft PowerPoint - 06-Body Data Class.pptx Digital 3D Anthropometry 6. Body Data Class Sungmin Kim SEOUL NATIONAL UNIVERSITY Body Data Class 의설계 Body Model 의관리 인체데이터입출력 데이터불러오기 인체모델그리기 TOpenGL의확장 프로젝트관리 프로젝트저장 / 불러오기 추가기능구현 좌표축정렬 Face, Wireframe,

More information

Microsoft PowerPoint - lecture17-ch8.ppt

Microsoft PowerPoint - lecture17-ch8.ppt OpenGL Texturing Texture Mapping 321190 2007년봄학기 6/2/2007 박경신 OpenGL 에서텍스쳐맵핑 (texture mapping) 을위한 3 단계 텍스쳐활성화 glenable(gl_texture_2d) 텍스쳐맵핑방법 ( 랩핑, 필터등 ) 정의 gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S,

More information

서강대학교 공과대학 컴퓨터공학과 CSE4170 기초 컴퓨터 그래픽스 중간고사 (1/8) [CSE4170: 기초 컴퓨터 그래픽스] 중간고사 (담당교수: 임 인 성) 답은 연습지가 아니라 답안지에 기술할 것. 있는 변환 행렬은 일반적으로 어떤 좌표계 에서 어떤 좌표계로의

서강대학교 공과대학 컴퓨터공학과 CSE4170 기초 컴퓨터 그래픽스 중간고사 (1/8) [CSE4170: 기초 컴퓨터 그래픽스] 중간고사 (담당교수: 임 인 성) 답은 연습지가 아니라 답안지에 기술할 것. 있는 변환 행렬은 일반적으로 어떤 좌표계 에서 어떤 좌표계로의 (/8) [CSE47: 기초 컴퓨터 그래픽스] 중간고사 (담당교수: 임 인 성) 답은 연습지가 아니라 답안지에 기술할 것 있는 변환 행렬은 일반적으로 어떤 좌표계 에서 어떤 좌표계로의 변환을 위하여 사용 하는가? 답안지 공간이 부족할 경우, 답안지 뒷면에 기 술하고, 해당 답안지 칸에 그 사실을 명기할 것 (i) 투영 참조점이 무한대점 (point at infinit)

More information

Microsoft PowerPoint - lecture18-ch8

Microsoft PowerPoint - lecture18-ch8 OpenGL Texturing Texture Mapping 321190 2007년봄학기 5/25/2007 박경신 OpenGL 에서텍스쳐맵핑 (texture mapping) 을위한 3 단계 텍스쳐활성화 glenable(gl_texture_2d) 텍스쳐맵핑방법 ( 랩핑, 필터등 ) 정의 gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S,

More information

Łø·ŸÕ=¤ ¬ ÇX±xÒ¸ 06 - Èpº– 1

Łø·ŸÕ=¤ ¬ ÇX±xÒ¸ 06 - Èpº– 1 그래픽스강의노트 06 - 조명 1 강영민 동명대학교 2015 년 2 학기 강영민 ( 동명대학교 ) 3D 그래픽스프로그래밍 2015 년 2 학기 1 / 25 음영 계산의 필요성 음영(陰影) 계산, 혹은 셰이딩(shading)은 어떤 물체의 표면에서 어두운 부분과 밝은 부분을 서로 다른 밝기로 그려내는 것 모든 면을 동일한 색으로 그리면 입체감이 없다. 2 /

More information

0503중간고사.dvi

0503중간고사.dvi 서강대학교 공과대학 컴퓨터공학과 CSE4170 기초 컴퓨터 그래픽스 중간고사 1/9 [CSE4170: 기초 컴퓨터 그래픽스] 중간고사 담당교수: 임 인 성 답은 반드시 답안지에 기술할 것. 공간이 부족할 경우 반드시 답안지 몇 쪽의 뒤에 있다고 명기한 후 기술할 것. 그 외의 경우의 답안지 뒤쪽이나 연습지 에 기술한 내용은 답안으로 인정 안함. 1. 2차원

More information

0503중간고사.dvi

0503중간고사.dvi 서강대학교 공과대학 컴퓨터공학과 CSE4170 기초 컴퓨터 그래픽스 중간고사 1/8 [CSE4170: 기초 컴퓨터 그래픽스] 중간고사 담당교수: 임 인 성 답은 연습지가 아니라 답안지에 기술할 것 있는 변환 행렬은 일반적으로 어떤 좌표계 에서 어떤 좌표계로의 변환을 위하여 사용 하는가? 답안지 공간이 부족할 경우, 답안지 뒷면에 기 술하고, 해당 답안지 칸에

More information

Microsoft Word - cg12-midterm-answer

Microsoft Word - cg12-midterm-answer 중간고사 담당교수 : 단국대학교멀티미디어공학전공박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호를기입하면성적공고시학번대신암호를사용할것임.. 맞으면 true, 틀리면 false를적으시오.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 06 Texture Mapping 01 Texture Mapping 의종류 02 Texture Mapping 이가능한객체생성 03 고급 Texture Mapping 01 Texture Mapping 의종류 1. 수동 Texture Mapping 2. 자동 Texture Mapping 2 01 Texture Mapping 의종류 좌표변환 Pipeline 에서

More information

歯Lecture2.PDF

歯Lecture2.PDF VISUAL C++/MFC Lecture 2? Update Visual C ++/MFC Graphic Library OpenGL? Frame OpenGL 3D Graphic library coding CLecture1View? OpenGL MFC coding Visual C++ Project Settings Link Tap Opengl32lib, Glu32lib,

More information

Microsoft PowerPoint - 05geometry.ppt

Microsoft PowerPoint - 05geometry.ppt Graphic Applications 3ds MAX 의기초도형들 Geometry 3 rd Week, 2007 3 차원의세계 축 (Axis) X, Y, Z 축 중심점 (Origin) 축들이모이는점 전역축 (World Coordinate Axis) 절대좌표 지역축 (Local Coordinate Axis) 오브젝트마다가지고있는축 Y Z X X 다양한축을축을사용한작업작업가능

More information

Microsoft PowerPoint - lecture4-ch2.ppt

Microsoft PowerPoint - lecture4-ch2.ppt Graphics Programming OpenGL Camera OpenGL 에서는카메라가물체의공간 (drawing coordinates) 의원점 (origin) 에위치하며 z- 방향으로향하고있다. 관측공간을지정하지않는다면, 디폴트로 2x2x2 입방체의 viewing volume을사용한다. (1, 1, 1) 321190 2007년봄학기 3/16/2007 박경신

More information

서강대학교공과대학컴퓨터공학과 CSE4170 기초컴퓨터그래픽스기말고사 (2/8) 다음과같이설정되어있는데, cam.pos[0] = 0.0, cam.pos[1] = 0.0, cam.pos[2] = 500.0; 이때의 cam.naxis[] 벡터의세원소값을기술하라. Figure

서강대학교공과대학컴퓨터공학과 CSE4170 기초컴퓨터그래픽스기말고사 (2/8) 다음과같이설정되어있는데, cam.pos[0] = 0.0, cam.pos[1] = 0.0, cam.pos[2] = 500.0; 이때의 cam.naxis[] 벡터의세원소값을기술하라. Figure 서강대학교공과대학컴퓨터공학과 CSE4170 기초컴퓨터그래픽스기말고사 (1/8) [CSE4170: 기초컴퓨터그래픽스 ] 기말고사 ( 담당교수 : 임인성 ) 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. OpenGL 시스템의각좌표계에대한약어는다음과같으며, 답을기술할때필요할경우적절히약어를사용하라.

More information

슬라이드 1

슬라이드 1 한국산업기술대학교 제 10 강광원 이대현교수 학습안내 학습목표 오우거엔진의광원을이용하여 3D 공갂에서광원을구현해본다. 학습내용 평면메쉬의생성방법광원의종류및구현방법 광원의종류 : 주변광원 주변광원 (Ambient Light) 동일한밝기의빛이장면안의모든물체의표면에서일정하게반사되는것. 공갂안에존재하는빛의평균값이론적인광원 광원의종류 : 지향광원 지향광원 (Directional

More information

Microsoft PowerPoint - 04-Model Class.pptx

Microsoft PowerPoint - 04-Model Class.pptx Digital 3D Anthropometry 4. Model Class Sungmin Kim SEOUL NATIONAL UNIVERSITY Model Class 의설계 모델링기법의개요 Introduction 3차원모델을정의하는클래스 점정보 면정보 법선벡터정보 색상정보 3차원모델과관련된기본함수 크기계산 법선벡터자동계산 이동 / 회전 기본물체만들기 데이터입출력

More information

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Function) 1. 함수의개념 입력에대해적절한출력을발생시켜주는것 내가 ( 프로그래머 ) 작성한명령문을연산, 처리, 실행해주는부분 ( 모듈 ) 자체적으로실행되지않으며,

More information

Open GL

Open GL Graphics OpenGL 컴퓨터그래픽스연구실 OpenGL 관련참고사이트 OpenGL 공식사이트 http://www.opengl.org/ Khronos Group http://www.khronos.org/ Nehe Productions http://nehe.gamedev.net/ OpenGL 파일셋팅 압축을푼후다음경로로파일을복사 헤더파일 (glut.h) Microsoft

More information

산선생의 집입니다. 환영해요

산선생의 집입니다. 환영해요 Biped Walking Robot Biped Walking Robot Simulation Program Down(Visual Studio 6.0 ) ). Version.,. Biped Walking Robot - Project Degree of Freedom : 12(,,, 12) :,, : Link. Kinematics. 1. Z (~ Diablo Set

More information

gnu-lee-oop-kor-lec06-3-chap7

gnu-lee-oop-kor-lec06-3-chap7 어서와 Java 는처음이지! 제 7 장상속 Super 키워드 상속과생성자 상속과다형성 서브클래스의객체가생성될때, 서브클래스의생성자만호출될까? 아니면수퍼클래스의생성자도호출되는가? class Base{ public Base(String msg) { System.out.println("Base() 생성자 "); ; class Derived extends Base

More information

Microsoft PowerPoint - lecture2-opengl.ppt [호환 모드]

Microsoft PowerPoint - lecture2-opengl.ppt [호환 모드] OpenGL & GLUT OpenGL & GLUT 321190 2011 년봄학기 3/15/2011 박경신 OpenGL http://www.opengl.org/ http://www.sgi.com/software/opengl Windows95 이후 OpenGL 이표준으로들어가있음. ftp://ftp.microsfot.com/softlib/mslfiles/opengl95.exe

More information

Microsoft PowerPoint - lecture3-ch2.ppt [호환 모드]

Microsoft PowerPoint - lecture3-ch2.ppt [호환 모드] Coordinate Systems Graphics Programming 321190 2014 년봄학기 3/14/2014 박경신 2D Cartesian Coordinate Systems 3D Cartesian Coordinate Systems Cartesian Coordination Systems -x +y y-axis x-axis +x Two axes: x-axis

More information

Microsoft PowerPoint - Lec06.ppt [호환 모드]

Microsoft PowerPoint - Lec06.ppt [호환 모드] Computer Graphics Kyoungju Park kjpark@cau.ac.kr http://graphics.cau.ac.kr Motion examples Topics Object orient programming Vectors and forces Bounce motion Physical universe Mathematical universe 시간흐를때

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 CHAPTER 11. 자바스크립트와캔버스로게임 만들기 캔버스 캔버스는 요소로생성 캔버스는 HTML 페이지상에서사각형태의영역 실제그림은자바스크립트를통하여코드로그려야한다. 컨텍스트객체 컨텍스트 (context) 객체 : 자바스크립트에서물감과붓의역할을한다. var canvas = document.getelementbyid("mycanvas"); var

More information

(Microsoft PowerPoint - CNVZNGWAIYSE.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - CNVZNGWAIYSE.ppt [\310\243\310\257 \270\360\265\345]) Viewing Viewing Process first part : model-view in Chapter 4 second part : projection in Chapter 5 world frame glmatrimode(gl_modelveiw) glmatrimode(gl_projection) camera frame camera 방향 object frame 5.

More information

LIDAR와 영상 Data Fusion에 의한 건물 자동추출

LIDAR와 영상 Data Fusion에 의한 건물 자동추출 i ii iii iv v vi vii 1 2 3 4 Image Processing Image Pyramid Edge Detection Epipolar Image Image Matching LIDAR + Photo Cross correlation Least Squares Epipolar Line Matching Low Level High Level Space

More information

(Microsoft PowerPoint - GEWZKYNMIJWQ.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - GEWZKYNMIJWQ.ppt [\310\243\310\257 \270\360\265\345]) Geometric Objects and Transformations 4. Scalars, Points, and Vectors Geometric View scalar : a real nmber.7 point : location in space.7,.5,.9 position 만있음. no sie ector : direction magnitde directed line

More information

Chap 6: Graphs

Chap 6: Graphs 그래프표현법 인접행렬 (Adjacency Matrix) 인접리스트 (Adjacency List) 인접다중리스트 (Adjacency Multilist) 6 장. 그래프 (Page ) 인접행렬 (Adjacency Matrix) n 개의 vertex 를갖는그래프 G 의인접행렬의구성 A[n][n] (u, v) E(G) 이면, A[u][v] = Otherwise, A[u][v]

More information

4.1 힘의모멘트 스칼라공식 4.1 힘의모멘트 스칼라공식 모멘트크기 (resultant moment) 2

4.1 힘의모멘트 스칼라공식 4.1 힘의모멘트 스칼라공식 모멘트크기 (resultant moment) 2 Engineering Mechanics 정역학 (Statics) 4장힘계의합력 1 GeoPave Lab. 4.1 힘의모멘트 스칼라공식 1 4.1 힘의모멘트 스칼라공식 4.1 힘의모멘트 스칼라공식 모멘트크기 (resultant moment) 2 4.1 힘의모멘트 The moment does not always cause r otation. The actual

More information

Structure and Interpretation of Computer Programs: Assignment 3 Seung-Hoon Na October 4, George (아래 3개의 문제에 대한 구현이 모두 포함된 george.rkt파일을 제출하시오.

Structure and Interpretation of Computer Programs: Assignment 3 Seung-Hoon Na October 4, George (아래 3개의 문제에 대한 구현이 모두 포함된 george.rkt파일을 제출하시오. Structure and Interpretation of Computer Programs: Assignment 3 Seung-Hoon Na October 4, 2018 1 George (아래 3개의 문제에 대한 구현이 모두 포함된 george.rkt파일을 제출하시오. 실행후 Problem 1.3에 대한 Display결과가 나와야 함) George 그림은 다음과

More information

Vector Differential: 벡터 미분 Yonghee Lee October 17, 벡터미분의 표기 스칼라미분 벡터미분(Vector diffrential) 또는 행렬미분(Matrix differential)은 벡터와 행렬의 미분식에 대 한 표

Vector Differential: 벡터 미분 Yonghee Lee October 17, 벡터미분의 표기 스칼라미분 벡터미분(Vector diffrential) 또는 행렬미분(Matrix differential)은 벡터와 행렬의 미분식에 대 한 표 Vector Differential: 벡터 미분 Yonhee Lee October 7, 08 벡터미분의 표기 스칼라미분 벡터미분(Vector diffrential) 또는 행렬미분(Matrix differential)은 벡터와 행렬의 미분식에 대 한 표기법을 정의하는 방법이다 보통 스칼라(scalar)에 대한 미분은 일분수 함수 f : < < 또는 다변수 함수(function

More information

(Microsoft PowerPoint - FZBDPQDCSHAN.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - FZBDPQDCSHAN.ppt [\310\243\310\257 \270\360\265\345]) Graphics Programming 2.1 The Sierpinski Gasket Sierpinski gasket 예제문제로사용 원래, Fractal geometry 에서정의 만드는방법 삼각형을그린다. 삼각형내부에 random 하게점 P i 를선택, 출력 random 하게꼭지점중의하나 V i 선택 V i 와 P i 의중점을 P i+1 로선택, 출력 위과정을반복

More information

Microsoft PowerPoint - GameProgramming16-Camera.ppt

Microsoft PowerPoint - GameProgramming16-Camera.ppt Biding a Feibe Camea Cass Feibe Camea Camea Design Imementation Detais Camea 예제 3589 28년봄학기 6/4/27 박경신 Camea Design 구현동기 고정된카메라위치설정을위해서 D3DXMatiookAtH( ) 함수사용 장점 : 고정된위치에카메라를놓고목표지점을겨냥 단점 : 사용자입력에반응하여카메라를이동

More information

untitled

untitled NV40 (Chris Seitz) NV1 1 Wanda NV1x 2 2 Wolfman NV2x 6 3 Dawn NV3x 1 3 Nalu NV4x 2 2 2 95-98: Z- CPU GPU / Geometry Stage Rasterization Unit Raster Operations Unit 2D Triangles Bus (PCI) 2D Triangles (Multitexturing)

More information

DocsPin_Korean.pages

DocsPin_Korean.pages Unity Localize Script Service, Page 1 Unity Localize Script Service Introduction Application Game. Unity. Google Drive Unity.. Application Game. -? ( ) -? -?.. 준비사항 Google Drive. Google Drive.,.. - Google

More information

(Microsoft PowerPoint - JXQEUPXIEBNZ.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - JXQEUPXIEBNZ.ppt [\310\243\310\257 \270\360\265\345]) Input and Interaction 3.1 Interaction Input 기능의처리 input : 사용자와의대화 O/S 와밀접한관계 문제점 : portability 에심각한장애 MS Windows 용으로작성하면, 거기서만작동 OpenGL approach OpenGL 은 portability 를중시 input 은 OpenGL 기능에서되도록제거 GLUT :

More information

(Microsoft PowerPoint - \301\24613\260\255 - oFusion \276\300 \261\270\274\272)

(Microsoft PowerPoint - \301\24613\260\255 - oFusion \276\300 \261\270\274\272) 게임엔진 제 13 강 ofusion 씬구성 이대현교수 한국산업기술대학교게임공학과 학습목차 Ofusion 을이용한 export Export 된씬의재현 씬노드애니메이션을이용한수동카메라트래킹 ofusion OGRE3D 엔진용 3D MAX 익스포터 http://www.ofusiontechnologies.com ofusion 의특징 Realtime Viewport 3D

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 11 장상속 1. 상속의개념을이해한다. 2. 상속을이용하여자식클래스를작성할수있다. 3. 상속과접근지정자와의관계를이해한다. 4. 상속시생성자와소멸자가호출되는순서를이해한다. 이번장에서만들어볼프로그램 class Circle { int x, y; int radius;... class Rect { int x, y; int width, height;... 중복 상속의개요

More information

Microsoft PowerPoint D View Class.pptx

Microsoft PowerPoint D View Class.pptx Digital 3D Anthropometry 5. 3D View Class Sungmin Kim SEOUL NATIONAL UNIVERSITY 3D View Class 의설계 3 차원그래픽의개요 Introduction Surface graphics Volume graphics Lighting and shading 3차원모델을 2차원화면에표시하는클래스 Rendering

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 5 장생성자와접근제어 1. 객체지향기법을이해한다. 2. 클래스를작성할수있다. 3. 클래스에서객체를생성할수있다. 4. 생성자를이용하여객체를초기화할수 있다. 5. 접근자와설정자를사용할수있다. 이번장에서만들어볼프로그램 생성자 생성자 (constructor) 는초기화를담당하는함수 생성자가필요한이유 #include using namespace

More information

C++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

chapter2.hwp

chapter2.hwp 2. 그래픽스프로그래밍의소개 2.1 OpenGL 이란? 2.1.1 OpenGL 의정의 2차원또는 3차원드로잉을위한표준그래픽스라이브러리 - 그래픽스하드웨어에대한소프트웨어인터페이스 - C나 C++ 과같은프로그래밍언어는아님 - 그래픽스하드웨어에잘구현될수있음 -C언어기반라이브러리 - 상태기반아키텍쳐 - 즉시모드 (Immediate mode) 기반 그래픽스라이브러리

More information

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600 균형이진탐색트리 -VL Tree delson, Velskii, Landis에의해 1962년에제안됨 VL trees are balanced n VL Tree is a binary search tree such that for every internal node v of T, the heights of the children of v can differ by at

More information

슬라이드 1

슬라이드 1 Visualization with 3D Engine Contents Assignment #3 3D engine으로 Robot Arm 제어 Shading Method( Normal Mapping, Environment Mapping ) Hierarchical control of Robot arm 3D Engine: 다누리VR Install & User Interface

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

컴퓨터그래픽스 기본요소

컴퓨터그래픽스 기본요소 Video & Image VIPLProcessing Lab. 2014-1 Myoung-Jin Kim, Ph.D. (webzealer@ssu.ac.kr) 목차 1 점그리기 2 선그리기 3 원그리기 4 다각형그리기 점그리기 점 하나의좌표로표현되는기하요소 y 3 차원그래픽스에서는기본적으로 50 x, y, z 의세좌표축으로표현되는 3 차원직교좌표계를사용하여 점의좌표를표현함

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

Your title goes here

Your title goes here www.cd-adapco.com Surface Preparation and Meshing 2012 년 5 월 8 일 CD-adapco Korea Introduction Surface Preparation STAR-CCM+ 3D CAD Model Indirect Mapped Interface Surface Preparation Workflow Overview[STAR-CCM]

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스, 객체, 메소드 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 필드만있는클래스 텔레비젼 2 예제 1. 필드만있는클래스 3 예제 2. 여러개의객체생성하기 4 5 예제 3. 메소드가추가된클래스 public class Television { int channel; // 채널번호 int volume; // 볼륨 boolean

More information

Microsoft PowerPoint - [2009] 02.pptx

Microsoft PowerPoint - [2009] 02.pptx 원시데이터유형과연산 원시데이터유형과연산 원시데이터유형과연산 숫자데이터유형 - 숫자데이터유형 원시데이터유형과연산 표준입출력함수 - printf 문 가장기본적인출력함수. (stdio.h) 문법 ) printf( Test printf. a = %d \n, a); printf( %d, %f, %c \n, a, b, c); #include #include

More information

Orcad Capture 9.x

Orcad Capture 9.x OrCAD Capture Workbook (Ver 10.xx) 0 Capture 1 2 3 Capture for window 4.opj ( OrCAD Project file) Design file Programe link file..dsn (OrCAD Design file) Design file..olb (OrCAD Library file) file..upd

More information

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures 단일연결리스트 (Singly Linked List) 신찬수 연결리스트 (linked list)? tail 서울부산수원용인 null item next 구조체복습 struct name_card { char name[20]; int date; } struct name_card a; // 구조체변수 a 선언 a.name 또는 a.date // 구조체 a의멤버접근 struct

More information

Microsoft PowerPoint - LA_ch6_1 [호환 모드]

Microsoft PowerPoint - LA_ch6_1 [호환 모드] Chapter 6 선형변환은무질서한과정과공학제어시스템의설계에관한연구에사용된다. 또한전기및음성신호로부터의소음여과와컴퓨터그래픽등에사용된다. 선형변환 Liear rasformatio 6. 6 변환으로서의행렬 Matrices as rasformatios 6. 변환으로서의행렬 6. 선형연산자의기하학 6.3 핵과치역 6.4 선형변환의합성과가역성 6.5 컴퓨터그래픽 si

More information

data

data 3D Game Programming 11 - ASE Animation afewhee@gmail.com 0. 목차 ASE 구조 Geometry Parsing Geometry Texture Parsing Material Texture Rigid Body Animation Scene Animation X-File Animation 1. ASE 구조 ASE Parsing

More information

슬라이드 1

슬라이드 1 Recursion SANGJI University KO Kwangman () 1. 개요 재귀 (recursion) 의정의, 순환 정의하고있는개념자체에대한정의내부에자기자신이포함되어있는경우를의미 알고리즘이나함수가수행도중에자기자신을다시호출하여문제를해결하는기법 정의자체가순환적으로되어있는경우에적합한방법 예제 ) 팩토리얼값구하기 피보나치수열 이항계수 하노이의탑 이진탐색

More information

Building Mobile AR Web Applications in HTML5 - Google IO 2012

Building Mobile AR Web Applications in HTML5 - Google IO 2012 Building Mobile AR Web Applications in HTML5 HTML5 -, KIST -, UST HCI & Robotics Agenda Insight: AR Web Browser S.M.AR.T: AR CMS HTML5 HTML5 AR - Hello world! - Transform - - AR Events 3/33 - - - (Simplicity)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

Microsoft PowerPoint - C++ 5 .pptx

Microsoft PowerPoint - C++ 5 .pptx C++ 언어프로그래밍 한밭대학교전자. 제어공학과이승호교수 연산자중복 (operator overloading) 이란? 2 1. 연산자중복이란? 1) 기존에미리정의되어있는연산자 (+, -, /, * 등 ) 들을프로그래머의의도에맞도록새롭게정의하여사용할수있도록지원하는기능 2) 연산자를특정한기능을수행하도록재정의하여사용하면여러가지이점을가질수있음 3) 하나의기능이프로그래머의의도에따라바뀌어동작하는다형성

More information

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for 2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon

More information

STATICS Page: 7-1 Tel: (02) Fax: (02) Instructor: Nam-Hoi, Park Date: / / Ch.7 트러스 (Truss) * 트러스의분류 트러스 ( 차원 ): 1. 평면트러스 (planar tru

STATICS Page: 7-1 Tel: (02) Fax: (02) Instructor: Nam-Hoi, Park Date: / / Ch.7 트러스 (Truss) * 트러스의분류 트러스 ( 차원 ): 1. 평면트러스 (planar tru STATICS Page: 7-1 Instructor: Nam-Hoi, Park Date: / / Ch.7 트러스 (Truss) * 트러스의분류 트러스 ( 차원 ): 1. 평면트러스 (planar truss) - 2 차원 2. 공간트러스 or 입체트러스 (space truss)-3 차원트러스 ( 형태 ): 1. 단순트러스 (simple truss) 삼각형형태의트러스

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070>

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070> #include "stdafx.h" #include "Huffman.h" 1 /* 비트의부분을뽑아내는함수 */ unsigned HF::bits(unsigned x, int k, int j) return (x >> k) & ~(~0

More information

슬라이드 1

슬라이드 1 프로세싱 광운대학교로봇학부박광현 프로세싱실행 2 C:\processing-3.2.1 폴더 창나타내기 실행 정지 3 폭 높이 600 400 도형그리기 배경칠하기 5 background(255, 255, 255); R G B background(255, 0, 0); background(255, 122, 0); 선그리기 6 background(255, 122, 0);

More information

untitled

untitled 전방향카메라와자율이동로봇 2006. 12. 7. 특허청전기전자심사본부유비쿼터스심사팀 장기정 전방향카메라와자율이동로봇 1 Omnidirectional Cameras 전방향카메라와자율이동로봇 2 With Fisheye Lens 전방향카메라와자율이동로봇 3 With Multiple Cameras 전방향카메라와자율이동로봇 4 With Mirrors 전방향카메라와자율이동로봇

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

PowerPoint Presentation

PowerPoint Presentation Blender 3D 를활용한 CAD/Surface Mesh Repair 삼성중공업해양부유체연구파트연성모 2016.09.29-30 Overview Background Blender3D Surface Repair에서의활용방법 Open Source Mesh Generator (SHM, cfmesh) 에서의활용방법 사용상의장애물 기타활용처 요약및결론 p2 Background

More information

C 언어 프로그래밊 과제 풀이

C 언어 프로그래밊 과제 풀이 과제풀이 (1) 홀수 / 짝수판정 (1) /* 20094123 홍길동 20100324 */ /* even_or_odd.c */ /* 정수를입력받아홀수인지짝수인지판정하는프로그램 */ int number; printf(" 정수를입력하시오 => "); scanf("%d", &number); 확인 주석문 가필요한이유 printf 와 scanf 쌍

More information

(Microsoft PowerPoint - JXEUOAACMYBW.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - JXEUOAACMYBW.ppt [\310\243\310\257 \270\360\265\345]) Discrete Techniques Historical Background 1970 년대 : local illumination models Phong shading : plastic 처럼보인다... 1980년대 : realism 의추구 global illumination models high cost, but very realistic texture mapping

More information

(Hyunoo Shim) 1 / 24 (Discrete-time Markov Chain) * 그림 이산시간이다연쇄 (chain) 이다왜 Markov? (See below) ➀ 이산시간연쇄 (Discrete-time chain): : Y Y 의상태공간 = {0, 1, 2,..., n} Y n Y 의 n 시점상태 {Y n = j} Y 가 n 시점에상태 j 에있는사건

More information

유니티 변수-함수.key

유니티 변수-함수.key C# 1 or 16 (Binary or Hex) 1:1 C# C# (Java, Python, Go ) (0101010 ). (Variable) : (Value) (Variable) : (Value) ( ) (Variable) : (Value) ( ) ; (Variable) : (Value) ( ) ; = ; (Variable) : (Value) (Variable)

More information

untitled

untitled 2006/10/24 라이스 순방이후 한반도 : 6자회담 재개 가능성 서보혁 (코리아연구원 연구위원 / 경남대 극동문제연구소 객원연구위원) I. 라이스의 순방 일지 II. 순방외교의 실패? III. 6자회담 재개 분위기 IV. 한국의 전략적 선택 라이스 순방이후 한반도 : 6자회담 재개 가능성 10월 17-12일 진행된 콘돌리자 라이스 미 국무장관의 4개국 순방이

More information

Microsoft PowerPoint - lecture19-ch8.ppt

Microsoft PowerPoint - lecture19-ch8.ppt Alpha Channel Alpha Blending 321190 2007년봄학기 6/1/2007 박경신 Alpha Channel Model Porter & Duff s Compositing Digital Images, SIGGRAPH 84 RGBA alpha는 4번째색으로불투명도 (opacity of color) 조절에사용함 불투명도 (opacity) 는얼마나많은빛이면을관통하는가의척도임

More information

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx 2018 학년도 1 학기 JAVA 프로그래밍 II 514760-1 2018 년봄학기 5/10/2018 박경신 Lab#1 (ImageTest) Lab#1 은영상파일 (Image) 을읽어서정보를출력 Java Tutorials Lesson: Working with Images https://docs.oracle.com/javase/tutorial/2d/images/index.html

More information

11장 포인터

11장 포인터 누구나즐기는 C 언어콘서트 제 9 장포인터 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 포인터란? 포인터 (pointer): 주소를가지고있는변수 메모리의구조 변수는메모리에저장된다. 메모리는바이트단위로액세스된다. 첫번째바이트의주소는 0, 두번째바이트는 1, 변수와메모리

More information

Microsoft PowerPoint - lecture16-ch8.ppt [호환 모드]

Microsoft PowerPoint - lecture16-ch8.ppt [호환 모드] OpenGL Texturing Texture Mapping 514780 017 년가을학기 11/16/017 단국대학교박경신 OpenGL 에서텍스쳐맵핑 (texture mapping) 을위한 3 단계 텍스쳐활성화 glenable(gl_texture_d) 텍스쳐맵핑방법 ( 랩핑, 필터등 ) 정의 gltexparameteri(gl_texture_d, GL_TEXTURE_WRAP_S,

More information

슬라이드 1

슬라이드 1 세모그래픽스 III. 게임프로그래밍에필요한 OpenGL Page 1 목차 1. 간단한 OBJ-C 2. IOS의 OGL VS Win32의 OGL 3. IOS개발환경설정 4. 뷰포트, 프로젝션, 모델뷰 ( 회전이먼저냐이동이먼저냐?) Page 2 세모그래픽스 간단한 OBJ-C 2011.07.16 김형석 Page 3 1. Obj-C (test2_cpp) #import

More information

1 Nov-03 CST MICROWAVE STUDIO Microstrip Parameter sweeping Tutorial Computer Simulation Technology

1   Nov-03 CST MICROWAVE STUDIO Microstrip Parameter sweeping Tutorial Computer Simulation Technology 1 CST MICROWAVE STUDIO Microstrip Parameter sweeping Tutorial Computer Simulation Technology wwwcstcom wwwcst-koreacokr 2 1 Create a new project 2 Model the structure 3 Define the Port 4 Define the Frequency

More information

JAVA PROGRAMMING 실습 08.다형성

JAVA PROGRAMMING 실습 08.다형성 2015 학년도 2 학기 1. 추상메소드 선언은되어있으나코드구현되어있지않은메소드 abstract 키워드사용 메소드타입, 이름, 매개변수리스트만선언 public abstract String getname(); public abstract void setname(string s); 2. 추상클래스 abstract 키워드로선언한클래스 종류 추상메소드를포함하는클래스

More information

미분기하학 II-16 복소평면의선형분수변환과쌍곡평면의등장사상 김영욱 (ÑñÁ) 강의양성덕 (zû ) 의강의록 Ø 'x! xxñ 2007 년 김영욱 (ÑñÁ) 강의양성덕 (zû ) 의강의록 (Ø 'x!) 미분기하 II 2007 년 1 / 26

미분기하학 II-16 복소평면의선형분수변환과쌍곡평면의등장사상 김영욱 (ÑñÁ) 강의양성덕 (zû ) 의강의록 Ø 'x! xxñ 2007 년 김영욱 (ÑñÁ) 강의양성덕 (zû ) 의강의록 (Ø 'x!) 미분기하 II 2007 년 1 / 26 미분기하학 II-16 복소평면의 김영욱 (ÑñÁ) 강의양성덕 (zû ) 의강의록 Ø 'x! xxñ 2007 년 김영욱 (ÑñÁ) 강의양성덕 (zû ) 의강의록 (Ø 'x!) 미분기하 II 2007 년 1 / 26 자, 이제 H 2 의등장사상에대해좀더자세히알아보자. Definition 선형분수변환이란다음형식의사상을뜻한다. Example f (z) = az +

More information

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3 Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3 Example 3.1 Files 3.2 Source code 3.3 Exploit flow

More information

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D> 리눅스 오류처리하기 2007. 11. 28 안효창 라이브러리함수의오류번호얻기 errno 변수기능오류번호를저장한다. 기본형 extern int errno; 헤더파일 라이브러리함수호출에실패했을때함수예 정수값을반환하는함수 -1 반환 open 함수 포인터를반환하는함수 NULL 반환 fopen 함수 2 유닉스 / 리눅스 라이브러리함수의오류번호얻기 19-1

More information

자연언어처리

자연언어처리 제 7 장파싱 파싱의개요 파싱 (Parsing) 입력문장의구조를분석하는과정 문법 (grammar) 언어에서허용되는문장의구조를정의하는체계 파싱기법 (parsing techniques) 문장의구조를문법에따라분석하는과정 차트파싱 (Chart Parsing) 2 문장의구조와트리 문장 : John ate the apple. Tree Representation List

More information