Game Development Reference
In-Depth Information
Vertices
Faces
Description
#
Position
Normal
Indices
0
(−1, +1, +1)
[−0.577, +0.577, +0.577]
Top
{0, 1, 2, 3}
1
(+1, +1, +1)
[+0.577, +0.577, +0.577]
Front
{2, 6, 7, 3}
2
(+1, +1, −1)
[+0.577, +0.577, −0.577]
Right
{2, 1, 5, 6}
3
(−1, +1, −1)
[−0.577, +0.577, −0.577]
Left
{0, 3, 7, 4}
4
(−1, −1, +1)
[−0.577, −0.577, +0.577]
Back
{0, 4, 5, 1}
5
(+1, −1, +1)
[+0.577, −0.577, +0.577]
Bottom
{4, 7, 6, 5}
6
(+1, −1, −1)
[+0.577, −0.577, −0.577]
7
(−1, −1, −1)
[−0.577, −0.577, −0.577]
Table 10.5. Polygon mesh of a box with welded vertices and smoothed edges
The basic problem is that the surface discontinuity at the box edges
cannot be properly represented because there is only one normal stored
per vertex. The solution to this problem is to “detach” the faces; in other
words, duplicate the vertices along the edge where there is a true geometric
discontinuity, creating a topological discontinuity to prevent the vertex nor-
mals from being averaged. After doing so, the faces are no longer logically
connected, but this seam in the topology of the mesh doesn't cause a prob-
lem for many important tasks, such as rendering and raytracing. Table 10.5
shows a smoothed box mesh with eight vertices. Compare that mesh to the
one in Table 10.6, in which the faces have been detached, resulting in 24
vertices.
Vertices
Faces
#
Position
Normal
Description
Indices
0
(−1, +1, +1)
[0, +1, 0]
Top
{0, 1, 2, 3}
1
(+1, +1, +1)
[0, +1, 0]
Front
{4, 5, 6, 7}
2
(+1, +1, −1)
[0, +1, 0]
Right
{8, 9, 10, 11}
3
(−1, +1, −1)
[0, +1, 0]
Left
{12, 13, 14, 15}
4
(−1, +1, −1)
[0, 0, −1]
Back
{16, 17, 18, 19}
5
(+1, +1, −1)
[0, 0, −1]
Bottom
{20, 21, 22, 23}
6
(+1, −1, −1)
[0, 0, −1]
7
(−1, −1, −1)
[0, 0, −1]
8
(+1, +1, −1)
[+1, 0, 0]
9
(+1, +1, +1)
[+1, 0, 0]
10
(+1, −1, +1)
[+1, 0, 0]
11
(+1, −1, −1)
[+1, 0, 0]
12
(−1, +1, +1)
[−1, 0, 0]
13
(−1, +1, −1)
[−1, 0, 0]
14
(−1, −1, −1)
[−1, 0, 0]
15
(−1, −1, +1)
[−1, 0, 0]
16
(+1, +1, +1)
[0, 0, +1]
17
(−1, +1, +1)
[0, 0, +1]
18
(−1, −1, +1)
[0, 0, +1]
19
(+1, −1, +1)
[0, 0, +1]
20
(+1, −1, −1)
[0, −1, 0]
21
(−1, −1, −1)
[0, −1, 0]
22
(−1, −1, +1)
[0, −1, 0]
23
(+1, −1, +1)
[0, −1, 0]
Table 10.6. Polygon mesh of a box with detached faces and lighting discontinuities at the
edges
Search WWH ::




Custom Search