Microsoft PowerPoint - lecture11-ch4.ppt

Similar documents
Microsoft PowerPoint - lecture11-ch4

PowerPoint 프레젠테이션

Microsoft Word - cg07-midterm.doc

Microsoft PowerPoint - 13prac.pptx

PowerPoint 프레젠테이션

Microsoft Word - cg07-final.doc

Microsoft PowerPoint - lecture15-ch6.ppt

04_오픈지엘API.key

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

Microsoft Word - cg08-final-answer.doc

Microsoft PowerPoint - lecture16-ch6

Microsoft Word - cg09-midterm.doc

Open GL

Open GL

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

슬라이드 1

Microsoft Word - cg09-final-answer.doc

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

Microsoft PowerPoint - 06-Body Data Class.pptx

Microsoft PowerPoint - lecture17-ch8.ppt

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

Microsoft PowerPoint - lecture18-ch8

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

0503중간고사.dvi

0503중간고사.dvi

Microsoft Word - cg12-midterm-answer

PowerPoint 프레젠테이션

歯Lecture2.PDF

Microsoft PowerPoint - 05geometry.ppt

Microsoft PowerPoint - lecture4-ch2.ppt

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

슬라이드 1

Microsoft PowerPoint - 04-Model Class.pptx

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

Open GL

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

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

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

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

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

쉽게 풀어쓴 C 프로그래밍

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

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

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

Chap 6: Graphs

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

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

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

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

Microsoft PowerPoint - GameProgramming16-Camera.ppt

untitled

DocsPin_Korean.pages

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

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

쉽게 풀어쓴 C 프로그래밍

Microsoft PowerPoint D View Class.pptx

쉽게 풀어쓴 C 프로그래밍

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

chapter2.hwp

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

슬라이드 1

chap 5: Trees

01-OOPConcepts(2).PDF

컴퓨터그래픽스 기본요소

Microsoft PowerPoint - chap06-2pointer.ppt

Your title goes here

PowerPoint Presentation

Microsoft PowerPoint - [2009] 02.pptx

Orcad Capture 9.x

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

Microsoft PowerPoint - LA_ch6_1 [호환 모드]

data

슬라이드 1

Building Mobile AR Web Applications in HTML5 - Google IO 2012

PowerPoint 프레젠테이션

Microsoft PowerPoint - C++ 5 .pptx

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

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

Microsoft Word - FunctionCall

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070>

슬라이드 1

untitled

untitled

PowerPoint Presentation

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

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


유니티 변수-함수.key

untitled

Microsoft PowerPoint - lecture19-ch8.ppt

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

11장 포인터

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

슬라이드 1

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

JAVA PROGRAMMING 실습 08.다형성

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

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

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D>

자연언어처리

Transcription:

Geometric Objects and Transformation 321190 2007 년봄학기 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();

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);

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 = 0.0 4.0 8.0 12.0 1.0 5.0 9.0 13.0 2.0 6.0 10.0 14.0 3.0 7.0 11.0 15.0 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행렬을곱함

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 또한, 이자동차가움직이게되면, 자동차의차체에서상대적인위치에있는바퀴두개도역시몸체와같이움직이게됨을알수있다. 이때, 두개의바퀴를자동차의몸체의변환에같이영향을받도록만들어하며, 바퀴가각자따로변환하지않도록한다.

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();

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 );

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

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) 을만들어낸다.

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 ; 7 4 3 2 6 0 1 5 (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 7 4 3 2 6 0 1 5 (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