Chapter 1: Modeling in Game Production
Chapter 1: Modeling in Game Production
- Tetrahedron: Four vertices: (0,0,0), (1,0,0), (0,1,0) and (0,0,1). The triangle normals should point out of the tetrahedron.
- a. The tetrahedron is exported to a right-hand system. Indexed triangle list representation
Vertex buffer:
| # | vertex |
|---|---|
| o | (0, 0, 0) |
| 1 | (1,0,0) |
| 2 | (0,1,0) |
| 3 | (0,0,1) |
Indexed buffer:
| index buffer | |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 0 | |
| 3 | |
| 1 | |
| 1 | |
| 3 | |
| 2 | |
| 0 | |
| 2 | |
| 3 |
- b. Same to a but left-hand system
Vertex buffer:
| # | vertex |
|---|---|
| 0 | (0,0,0) |
| 1 | (1,0,0) |
| 2 | (0,1,0) |
| 3 | (0,0,1) |
Index buffer
| Index buffer | |
|---|---|
| 1 | |
| 3 | |
| 2 | |
| 1 | |
| 2 | |
| 0 | |
| 3 | |
| 0 | |
| 2 | |
| 1 | |
| 0 | |
| 3 |
- v, e, and f denote the number of vertices, edges, and faces of a closed triangles mesh.
- Euler's polyhedron formula asserts:
-
Every edge is shared by two faces, every face has three edge. Therefore, if we count 2 faces per edges, the counted number will be three times the number of faces of the mesh. (Take the tetrahedron for an example)
-
Replace above equation above we have:
-
As the mesh size increases, the number of faces (f) converges to twice the number of vertices (v).
-
Replace to Euler's formula:
Chapter 2: Vertex Processing
- 2D affine transform matrix rotates a 2D point by about a point (a,b), not origin.