Graphics Reference
In-Depth Information
cross product result to be the zero vector (and making the computation suffer large
cancellation errors well before becoming zero).
Even if the angle between the edges is large, there is still a problem. Assume all
vertices lie on a plane, except for the vertex V shared by the two edges. Let V deviate
from the plane by some distance d . If the polygon is scaled up in the plane, V will
remain at a distance d from the plane and the absolute planarity of the polygon
should not be affected. However, because the cross product of those two edges was
chosen as the representative plane normal, all vertices but the three coincident with
the two edges will move arbitrarily far from the chosen plane as the polygon is
scaled up.
It seems clear that all vertices should somehow be involved in the normal com-
putation. One common approach is to compute the normal n i at each vertex V i
(as the cross product of the edges incident at the vertex) and then average the
normals:
n
0
1
=
=
×
n
n i ,
where n i
( V i + 1
V i )
( V i 1
V i ).
i
<
n
V n 1 . Because the magnitude of n is
unimportant, the normals can be summed rather than averaged.
Although this works well for convex polygons, it is unfortunately flawed for non-
convex polygons. Normals computed at concave vertices will point in the opposite
direction of those computed at convex vertices. For example, consider the class of
star-shaped polygons shown in Figure 12.16. The normals at the even-numbered
vertices point out of the page, whereas the normals of the odd-numbered vertices
point into the page.
It is here assumed that V n
=
V 0 and V 1
=
K = 1
K = 4
V 0 = (1, 1, 1)
V 1 = (6, 6 - K , 1)
V 2 = (11, 1, 1)
V 3 = (6 + K , 6, 1)
V 4 = (11, 11, 1)
V 5 = (6, 6 + K , 1)
V 6 = (1, 11, 1)
V 7 = (6 - K , 6, 1)
Figure 12.16 A class of star-shaped polygons, parameterized by K ,0< K <5.
Search WWH ::




Custom Search