Graphics Reference
In-Depth Information
When normals of opposing direction are summed, the result may point in either
direction, depending on the relative magnitudes of the inputs. Specifically, in this case
the following (unnormalized) normals are obtained for a few different values of K :
K
n
1
(0, 0,
124)
2
(0, 0,
56)
3
(0, 0, 4)
4
(0, 0, 56)
As the table indicates, the normal changes direction between K
=
2 and K
=
3.
In fact, at about K
=
2. 928932 the normal becomes the zero vector and the method
fails catastrophically!
It turns out that a much better and robust approach to computing normals is one
commonly known as Newell's method [Tampieri92]. Newell's method uses the fact
that the components of a polygon normal are proportional to the signed areas of
the projections of the polygon onto the yz , xz , and xy planes. n can therefore be
computed as:
n x
=
( V i , y
V i + 1, y )( V i , z
+
V i + 1, z )
0
i
<
n
n y =
( V i , z
V i + 1, z )( V i , x +
V i + 1, x )
0
i
<
n
n z
=
( V i , x
V i + 1, x )( V i , y
+
V i + 1, y )
0
i
<
n
The terms being summed correspond to twice the signed area of the trapezoids
formed, in each principal plane, by the current polygon edge and its projection onto
the corresponding axis. The first term is the width of the trapezoid; the second term
is twice its height. By rearranging terms, it can be seen that Newell's method is
equivalent to computing the normal through the sum:
n
=
m i ,
where m i =
V i ×
V i + 1 .
0
i
<
n
Search WWH ::




Custom Search