Graphics Reference
In-Depth Information
We can see this, in the case that the polygon is a triangle, by examining coordi-
nates: If
P
i
=(
x
i
,
y
i
,
z
i
)
for
i
=
0, 1, 2, then
n
1
, the first entry of the cross product,
is just
n
1
=(
y
1
−
y
0
)(
z
2
−
z
1
)
−
(
y
2
−
y
1
)(
z
1
−
z
0
)
.
(7.126)
The area formula for a plane polygon, Equation 7.124, applied to the projec-
tion of
P
0
P
1
P
2
to the
yz
-plane, gives
n
A
xy
=
1
2
(
y
i
z
i
+
1
−
z
i
y
i
+
1
)
, so
(7.127)
i
=
0
2
A
xy
=(
y
0
z
1
−
z
0
y
1
)+(
y
1
z
2
−
z
1
y
2
)+(
y
2
z
0
−
z
2
y
0
)
.
(7.128)
The eight terms in the expansion of the expression for
n
1
match the six terms in
the expression for 2
A
xy
because two
y
1
z
1
terms have opposite signs and cancel.
The computations for
n
2
and
n
3
are similar. Thus, the vector
⎡
⎤
A
yz
A
zx
A
xy
⎣
⎦
a
=
(7.129)
is twice the cross product; since half the length of the cross product is that triangle
area, we see that the length of
a
is the triangle area.
The more general case follows by decomposing the polygon into a union of
triangles.
The advantage of Plücker's formula as applied to polygons in space is that if
there are small numerical errors in the coordinates of a single vertex, they have
relatively little impact on the computed normal vector.
If we have a polygon
P
0
P
1
...
P
n
inaplane
S
whose normal is the unit vector
n
,
we can find two orthogonal unit vectors
x
and
y
in
S
such that
x
,
y
,
n
is positively
oriented, that is,
n
=
x
y
. Choosing some point of the plane as the origin, we
have a coordinate system. We can then write the coordinates of each
P
i
in the
xyn
-
coordinate system; the third coordinate will be zero, so the coordinates of
P
i
will
be
(
x
i
,
y
i
,0
)
. We can apply the formula for a signed area to these coordinates. In
the case of a triangle, if the signed area is positive (resp. negative), we say that
the triangle is
positively
(resp.
negatively
)
oriented.
Notice, though, that if we
had used
×
n
instead of
n
, the signs would have changed: The signed area, and the
orientation of a triangle, are only defined relative to a plane-with-normal.
Just as in the case of the
xz
-plane, a triangle is positively oriented in a plane
with normal
n
if, as we look from the tip of
n
toward the plane, the vertices of the
triangle appear in counterclockwise order.
When we speak of the signed area of a polygon in the
zx
-plane, we mean that
we're using a coordinate system in which the first basis vector is
001
T
,the
second is
100
T
, and the normal vector is
010
T
; a parallel description
applies to the
xy
- and
yz
-planes.
−