7 - Hierarchical Modeling, Mesh
Midterm Exam Announcement
- ์ผ์: 5์ 7์ผ (์) ์คํ 6:30 ~ 7:30
- ์ฅ์: ์ถํ ๊ณต์ง
- ๋ฒ์: Lecture 2~7, Lab 2~7
- ์ํ ์์ ํ 30๋ถ ์ด๋ด ํด์ค ๋ถ๊ฐ
- ์ํ ์์ ํ 30๋ถ์ด ์ง๋๋ฉด ์ ์ค๋ ๋ถ๊ฐ (์ ๋ ์ง๊ฐ ๊ธ์ง)
- ํ์์ฆ ํ์ ์ง์ฐธ
Outline
- Hierarchical Modeling
- ๊ณ์ธต์ ๋ชจ๋ธ๋ง ๊ฐ๋
- ์: ์ฌ๋ ๋ชจํ
- ๊ณ์ธต ๋ชจ๋ธ ๋ ๋๋ง
- ์ผ๋ จ์ ๋ณํ ํด์
- ๊ณ์ธต์ ๋ชจ๋ธ๋ง ๊ฐ๋
- Mesh
- ๊ฐ๋ณ ์ผ๊ฐํ
- ์ธ๋ฑ์ค ์ผ๊ฐํ ์งํฉ
Hierarchical Modeling
- ํ์ ๊ตฌ์ฑ ์์(์์)๋ฅผ ์์ ๊ตฌ์ฑ ์์(๋ถ๋ชจ)์ ์ค์ฒฉํ์ฌ ํธ๋ฆฌ ๊ตฌ์กฐ๋ก ํํ
- ๊ฐ ํํธ๋ ๊ณ ์ ํ body frame์ ๊ฐ์ง
- ๊ฐ ํํธ์ ์์ง์์ ๋ถ๋ชจ์ body frame ๊ธฐ์ค์ผ๋ก ๊ธฐ์ ๋จ
Example - Human Figure
- ๊ฐ ํํธ๋ ๋ค์๊ณผ ๊ฐ์ ํธ๋ฆฌ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง:
- Hips โ Spine โ Head / ํ / ๋ค๋ฆฌ โ ์๋ฐ
Human Figure - Frames
- ๊ฐ ํํธ๋ ๊ณ ์ ํ body frame์ ๊ฐ์ง
Human Figure - Movement of rhip & rknee and more joints
- ๊ฐ ํํธ์ ์์ง์์ ๋ถ๋ชจ์ frame ๊ธฐ์ค์ผ๋ก ๊ธฐ์ ๋จ
- ๊ฐ ํํธ๋ ๋ถ๋ชจ frame ๊ธฐ์ค์ ๋ณํ ํ๋ ฌ(โtransformation) ์ ๊ฐ์ง
- ์ด๋ ํ์ ํํธ๋ฅผ "๋ฌถ์ด์(group)" ์ ์ดํ ์ ์๊ฒ ํด ์ค
Hierarchical Model
- ๊ณ์ธต์ ๋ชจ๋ธ์ ์ผ๋ฐ์ ์ผ๋ก ํธ๋ฆฌ ๊ตฌ์กฐ(tree structure)๋ก ํํ๋จ
- ์ ์ฒด ์ฅ๋ฉด(scene)์ ํํํ๋ ๊ทธ๋ํ ๊ตฌ์กฐ scene graph๋ ์์
- ๊ฐ ๋ ธ๋๋ ๋ถ๋ชจ ๋ ธ๋์ frame ๊ธฐ์ค์ ๋ณํ์ ๊ฐ์ง
Rendering Hierarchical Models
- ๊ณ์ธต ๋ชจ๋ธ์ ๋ ๋๋งํ๋ ค๋ฉด,
๊ฐ ๋ ธ๋์ frame์ world frame ๊ธฐ์ค์ผ๋ก ๋ณํํด์ผ ํจ โ ๊ฐ ์ ์ ์ global ์์น ๊ณ์ฐ - ๋ณต์ต:
- ์ ์์ ๋ฅผ ๋ด โ
- ์ ์์ ๋ฅผ ๋ด โ
Rendering Hierarchical Models
- ๊ฐ ๋
ธ๋๋ ๋ถ๋ชจ ๋
ธ๋ ๊ธฐ์ค์ ๋ณํ(local transformation)์ ๊ฐ์ง
โ Local transformation - ์:
- Hip ์์น ๋ฐ ์์ธ:
M_hips - LeftUpLeg ์์น ๋ฐ ์์ธ:
M_leftupleg(hips ๊ธฐ์ค)
- Hip ์์น ๋ฐ ์์ธ:
Rendering Hierarchical Models
- ๊ฐ ๋
ธ๋์ frame์ world frame ๊ธฐ์ค์ผ๋ก ํํํด์ผ ๋ ๋๋ง ๊ฐ๋ฅ
โ Global transformation - ์ง๋ฌธ:
- ๋ค๋ฅธ ๋ ธ๋์ local ๋ณํ์ ์ด์ฉํด์ ์ด๋ป๊ฒ global ๋ณํ์ ๊ณ์ฐํ ์ ์์๊น?
Recall: Post-(right) Multiplication
- (Mโ์ post-multiply)
โ L-to-R
- : body frame {0} โ {1} ๋ณํ
- : body frame {1} โ {2} ๋ณํ
- : {2}์ ์ โ {0} ๊ธฐ์ค์ผ๋ก ์์น ๊ณ์ฐ
์:
Interpretation of a Series of Transformations
(์ฒ์ ์ํ๋ ๋จ์ํ๋ ฌ ๊ธฐ์ค)
{0}์ ์์ ๋ฌผ์ฒด๋ฅผ ๊ด์ธกํ๋ฉฐ
{0} โ {1} โ {2} โ ... โ {4} ์์ผ๋ก body frame์ด ๋ณํจ- ํ์ฌ body frame: {1}, ๊ธฐ์ค: {0}
- {1}์์ ๊ด์ฐฐ ์ โ
- {0}์์ ๊ด์ฐฐ ์ โ
- ํ์ฌ body frame: {2}, ๊ธฐ์ค: {0}
- {2}์์ ๊ด์ฐฐ ์ โ
- {0}์์ ๊ด์ฐฐ ์ โ
- ํ์ฌ body frame: {3}, ๊ธฐ์ค: {0}
- {3}์์ ๊ด์ฐฐ ์ โ
- {0}์์ ๊ด์ฐฐ ์ โ
- ํ์ฌ body frame: {4}, ๊ธฐ์ค: {0}
- {4}์์ ๊ด์ฐฐ ์ โ
- {0}์์ ๊ด์ฐฐ ์ โ
๋ฐ๋ณต ๊ตฌ์กฐ ์ ๋ฆฌ
- {4}์์ ๋ฅผ ๋ฐ๋ผ๋ณด๋ ๊ด์ฐฐ ๊ฒฐ๊ณผ โ
- {0}์์ ๋ฅผ ๋ฐ๋ผ๋ณด๋ ๊ด์ฐฐ ๊ฒฐ๊ณผ ๊ทธ๋๋ก โ
๋์ผ ๋ด์ฉ ์๊ฐํ:
- ์์๋ก ์ ์ฉ
- ๊ฐ ๋ณํ์ ์ด์ ๋ ธ๋์ body frame ๊ธฐ์ค์ผ๋ก ์ ์ฉ๋จ
- ๋ง์ง๋ง์ผ๋ก ๋ฅผ ๋ณํํ์ฌ ํ๋
Computing Global Transform from Series of Local Transforms
- node 4์ global transformation:
- ๊ฐ : ๋ฒ์งธ ๋ ธ๋์ local transformation
- ์ ์ฉ ์์:
- node 1์ body frame ๊ธฐ์ค โ node 2 โ node 3 โ node 4
| Node | Global Transform |
|---|---|
| Hips | |
| Spine | |
| Head | |
| RightArm | |
| RightForeArm | |
| RightHand | |
| LeftArm |
- ํธ๋ฆฌ ๊ตฌ์กฐ ๊ธฐ๋ฐ์ผ๋ก ๊ฐ ๋ ธ๋์ global ๋ณํ ๊ณ์ฐ ๊ฐ๋ฅ
Rendering Hierarchical Models
- ๋ฒ์งธ ๋
ธ๋๊ฐ ๋จ์ ํ๋ธ๋ก ๋ ๋๋ง๋๋ค๊ณ ๊ฐ์ ํ ๋,
- ๋จ์ ํ๋ธ์ ์ ์ ๋ world frame์์ ๋ก ํํ๋จ
| Node | Global Transform |
|---|---|
| Hips | |
| Spine | |
| Head | |
| RightArm | |
| RightForeArm | |
| LeftArm | |
Rendering Hierarchical Models - Shape Transformation
- ๋ง์ฝ ๋ฒ์งธ ๋
ธ๋๊ฐ ๋จ์ ํ๋ธ๊ฐ ์๋๋ผ ํน์ shape ๋ก ๋ ๋๋ง๋๋ค๋ฉด,
- ํน์ ๋ ธ๋ ์ ๋ฒ์งธ shape์ ๋ํด shape ๋ณํ ๋ฅผ ์ฌ์ฉํ ์ ์์
Rendering Hierarchical Models
- ๋ฒ์งธ ๋ ธ๋๋ง๋ค global transform ๋ฅผ ์ ์ฅํ์ฌ ๋ ๋๋ง ์ ์ฌ์ฌ์ฉ ๊ฐ๋ฅ
Quiz 1
Many ways to digitally encode geometry
- EXPLICIT
- point cloud
- polygon mesh
- subdivision, NURBS
- L-systems
- ...
- IMPLICIT
- level set
- algebraic surface
- ...
- ๊ฐ ํํ ๋ฐฉ์์ ๊ณผ์ /๊ธฐํ ์ ํ์ ๋ฐ๋ผ ์ ํฉํ ์ ํ์ง๊ฐ ๋ค๋ฆ
The Most Popular Representation: Polygon Mesh
- ๋จ์ํ ํํ์ผ๋ก ๋ณต์กํ 3D ํ์์ ๋ชจ๋ธ๋ง ๊ฐ๋ฅํ๋ฉฐ ๋ ๋๋ง ์๋๋ ๋น ๋ฆ
- Polygon: ์ง์ ์ผ๋ก ๋๋ฌ์ธ์ธ โ๋ซํโ ๋ํ
- Polygon mesh: ์ฌ๋ฌ polygon์ด ์ด์ด์ ธ์ ํ์์ ๊ตฌ์ฑํ๋ ๊ตฌ์กฐ
- ์ฃผ๋ก triangle ๋๋ quad ์ฌ์ฉ
Triangle Mesh
- ์ผ๋ฐ์ ์ธ ๊ฐํ์
- ํ๋ฉด์ด ์๋ ์๋ ์๊ณ
- ์ค๋ชฉํ ์ ์์ผ๋ฉฐ
- ๋ ๋๋ง์ ์ ํฉํ์ง ์
- ๋ฐ๋ฉด triangle์ ํญ์ ํ๋ฉด์ด๋ฉฐ convex ํํ
- ๋ฐ๋ผ์ GPU๋ ๋ชจ๋ ๋ฌผ์ฒด๋ฅผ triangle๋ก ๋ถํดํ์ฌ ์ฒ๋ฆฌ
- ๊ฐํ๋ triangle๋ก ๋๋ ์ ์์
- ๊ฒฐ๋ก : Triangle mesh ์ค์ฌ์ผ๋ก ํ์ต
Representation for Triangle Mesh
- ์ด ์ฃผ์ ๋ ๋ฉ๋ชจ๋ฆฌ์ ์ ์ ์ ์ ์ฅํ๋ ๋ฐฉ์์ ๋ํ ๊ฒ
- ์ ์ ์ ์์น
- ์ ์ ๊ฐ ๊ด๊ณ(์ผ๊ฐํ ๊ตฌ์ฑ)
- ๊ธฐ๋ณธ์ ์ธ ๋ ๊ฐ์ง ํํ ๋ฐฉ์:
- Separate triangles
- Indexed triangle set
Vertex Winding Order
- Vertex winding order๋ ๋ค๊ฐํ์ ์ ์ ๋ค์ด ๋์ด๋๋ ์์
- ์ด ์์๋ก ๋ค๊ฐํ์ ์๋ฉด์ ๊ฒฐ์ ํจ
- OpenGL: ๋ฐ์๊ณ ๋ฐฉํฅ(CCW)์ด ์๋ฉด
- Direct3D: ์๊ณ ๋ฐฉํฅ(CW)์ด ์๋ฉด
Separate triangles
- counter-clockwise ์์๋ก ์ ์ ๋์ด
- ์์:
- vertex array:
Separate Triangles
- ๋จ์ :
- ๋ฉ๋ชจ๋ฆฌ ๋ญ๋น
- ๋ฐ์ฌ๋ฆผ ์ค์ฐจ๋ก ์ธํ ํ ๋ฐ์
- ์ธ์ ์ผ๊ฐํ ํ์ ์ด๋ ค์
- ์ ์ด์ ์ผ๊ฐํ์ ์ฐพ๊ธฐ ์ํด, ์ ์ ์ ์ค ๊ฑฐ๋ฆฌ ์ธ ์ ์ ์ ์ ๋ถ ๋น๊ตํด์ผ ํจ
Example: a cube of length 2
- ์ ์ ์ธ๋ฑ์ค ๋ฐ ์์น ์:
| index | position |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 |
Example Cube in Separate Triangles
- Separate triangle ํํ ๋ฐฉ์์์๋
- ์ ์ 36๊ฐ๋ก cube์ 12๊ฐ ์ผ๊ฐํ ํํ
- vertex array์์ ๋์ผ ์ ์ ์ด ์ฌ๋ฌ ๋ฒ ๋ฐ๋ณต๋จ
Indexed triangle set
- ๊ฐ ์ ์ ์ ํ ๋ฒ๋ง ์ ์ฅ
- ๊ฐ ์ผ๊ฐํ์ 3๊ฐ์ ์ ์ ์ธ๋ฑ์ค๋ฅผ ๊ฐ๋ฆฌํด
- counter-clockwise ์์
- ์์:
- vertex array:
- index array:
Indexed Triangle Set
- ๋ฉ๋ชจ๋ฆฌ ํจ์จ์ : ๊ฐ ์ ์ ์์น๋ ํ ๋ฒ๋ง ์ ์ฅ๋จ
- ์์(topology)๊ณผ ๊ธฐํ(geometry)๋ฅผ ๋ถ๋ฆฌํ์ฌ ํํ
- Topology: ์ ์ ๋ค์ด ์ด๋ป๊ฒ ์ฐ๊ฒฐ๋์ด ์ผ๊ฐํ์ ๊ตฌ์ฑํ๋์ง
- Geometry: ์ ์ ๋ค์ด ๊ณต๊ฐ์ ์์นํ๋ ์ค์ ์ขํ
- ์ธ์ ์ผ๊ฐํ ํ์์ด ๋ช
ํํจ
- ์ธ์ ์ผ๊ฐํ์ ๋์ผํ ์ ์ ์ธ๋ฑ์ค๋ฅผ ๊ณต์ ํจ
Example Cube in Indexed Triangle Set
- Indexed triangle set ๋ฐฉ์์์๋
- ์ ์ 8๊ฐ์
- ์ผ๊ฐํ 12๊ฐ์ ์ ์ ์ธ๋ฑ์ค๋ก cube๋ฅผ ํํํจ
Quiz 2
Creating Polygon Meshes
- ์ผ๋ฐ์ ์ผ๋ก polygon mesh๋ 3D ๋ชจ๋ธ๋ง ํ๋ก๊ทธ๋จ์ผ๋ก ์์ฑ๋จ
- ์ด ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋ ํ์ผ์ object file ๋๋ model file์ด๋ผ ๋ถ๋ฆ
- ์์ฉํ๋ก๊ทธ๋จ(์: ๊ฒ์)์ ์ด object file์์ ์ ์ ๊ณผ ์ธ๋ฑ์ค๋ฅผ ๋ก๋ํ์ฌ ๊ฐ์ฒด๋ฅผ ๊ทธ๋ฆผ
3D Model File Formats
- DXF โ AutoCAD
- 2D, 3D ๋ฐ์ด๋๋ฆฌ ์ง์
- 3DS โ 3DS MAX
- ์ ์ฐํ ์ด์ง ํ์
- VRML โ Virtual reality modeling language
- ASCII ๊ธฐ๋ฐ, ์ฌ๋์ด ์ฝ๊ณ ์ธ ์ ์์
- OBJ โ Wavefront OBJ format
- ASCII ๊ธฐ๋ฐ (์ฌ๋์ด ์ฝ๊ณ ํธ์ง ๊ฐ๋ฅ)
- ๋งค์ฐ ๋จ์ํ๊ณ ๋๋ฆฌ ์ฌ์ฉ๋จ
- ์ด ์ฌ๋ผ์ด๋์์๋ OBJ ํฌ๋งท์ ์์ธํ ์ดํด๋ด
OBJ File Format
# ์ฃผ์
# vertex positions: (x, y, z)
v 0.123 0.234 0.345
v 0.2 0.5 0.3
...
# vertex normals: (x, y, z)
vn 0.707 0.000 0.707
...
# vertex texture coordinates (u, v)
vt 0.500 1
...
# ๋ฉด(faces) ์ ์ (๋ชจ๋ ์ธ๋ฑ์ค๋ 1๋ถํฐ ์์)
# ์ ์ ์ธ๋ฑ์ค๋ง ์๋ ๊ฒฝ์ฐ
f 1 2 3
f 2 3 4
# ์ ์ /ํ
์ค์ฒ/๋
ธ๋ฉ ์ธ๋ฑ์ค
f 6/4/1 3/3/7 6/3/6
# ์ ์ /๋
ธ๋ฉ ์ธ๋ฑ์ค
f 1//1 8//2 9//3
# ์ ์ /ํ
์ค์ฒ ์ธ๋ฑ์ค
f 3/1 4/2 5/3
๊ธฐํ ์ง์ ๊ธฐ๋ฅ:
์ (Polyline)
l 1 5 8 2 4 9์ฌ์ง(Materials)
mtllib [์ธ๋ถ .mtl ํ์ผ ์ด๋ฆ] usemtl [์ฌ์ง ์ด๋ฆ]
๋ณธ ์์ ์์๋ ์ ๊ธฐ๋ฅ๋ค์ ์ฌ์ฉํ์ง ์์
An OBJ Example
# A simple cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
f 1 2 3 4
f 5 8 7 6
f 1 5 6 2
f 2 6 7 3
f 3 7 8 4
f 5 1 4 8
OBJ Sources
์ ์ฌ์ดํธ๋ค์์
.obj๋ชจ๋ธ ํ์ผ์ ๋ค์ด๋ก๋ ๋ฐ์ Blender์์ ์ด ์ ์์OBJ ํ์ผ ํ์์ ๋งค์ฐ ๋ณดํธ์ ์:
- ๋๋ถ๋ถ์ ๋ชจ๋ธ๋ง ํ๋ก๊ทธ๋จ์ด OBJ ํฌ๋งท์ผ๋ก export ๊ฐ๋ฅ
- ๋๋ถ๋ถ์ ๋ ๋๋ง ํจํค์ง๊ฐ OBJ ํฌ๋งท์ ์ฝ์ ์ ์์

