Game Development Reference
In-Depth Information
Figure 10.11. A simple mesh containing a cube and a pyramid
Assuming the origin is on the “ground” directly between the two objects,
the vertex coordinates might be as shown in Table 10.3.
0
(−3, 2, 1)
4
(−3, 0, 1)
8
(2, 2, 0)
12
(1, 0, −1)
1
(−1, 2, 1)
5
(−1, 0, 1)
9
(1, 0, 1)
2
(−1, 2, −1)
6
(−1, 0, −1)
10
(3, 0, 1)
3
(−3, 2, −1)
7
(−3, 0, −1)
11
(3, 0, −1)
Table 10.3. Vertex positions in our sample mesh
Table 10.4 shows the vertex indices that would form faces of this mesh,
either as a polygon mesh or as a triangle mesh. Remember that the order
of the vertices is significant; they are listed in clockwise order when viewed
from the outside. You should study these figures until you are sure you
understand them.
Vertex indices
Vertex indices
Description
(Polygon mesh)
(Triangle mesh)
Cube top
{0, 1, 2, 3}
{1, 2, 3} , {1, 3, 0}
Cube front
{2, 6, 7, 3}
{2, 6, 7} , {2, 7, 3}
Cube right
{2, 1, 5, 6}
{2, 1, 5} , {2, 5, 6}
Cube left
{0, 3, 7, 4}
{0, 3, 7} , {0, 7, 4}
Cube back
{0, 4, 5, 1}
{0, 4, 5} , {0, 5, 1}
Cube bottom
{4, 7, 6, 5}
{4, 7, 6} , {4, 6, 5}
Pyramid front
{12, 8, 11}
{12, 8, 11}
Pyramid left
{9, 8, 12}
{9, 8, 12}
Pyramid right
{8, 10, 11}
{8, 10, 11}
Pyramid back
{8, 9, 10}
{8, 9, 10}
Pyramid bottom
{9, 12, 11, 10}
{9, 12, 11} , {9, 11, 10}
Table 10.4. The vertex indices that form the faces of our sample mesh, either as a polygon
mesh or a triangle mesh
 
Search WWH ::




Custom Search