Graphics Reference
In-Depth Information
If the volume is positive, the polygon is facing the observer; if the volume is zero, the polygon
is parallel to the observer; and if the volume is negative, the polygon is facing away from the
observer. Let's test this hypothesis with an example.
Figure 2.30 shows a scenario where the observer is located at 1 0 0 looking at one of the
triangle's vertices positioned at the origin.
Y
(0, 1, 1)
b
(0, 0, 0)
a
(1, 0, 0)
(0, 0, 2)
c
Z
X
Figure 2.30.
Therefore, the vectors are a
=
i b
=
j
+
k c
=
2 k , and the prism's volume is given by
100
011
002
1
6
1
6 ×
Vol
=
=
2
which means that the polygon is visible. If we locate the observer at 0 0
1 along the negative
z-axis, the volume is zero:
00
1
011
002
1
6
Vol
=
=
0
which means that the polygon is invisible. Finally, if we locate the observer at
1 0 0, the
volume is negative:
100
011
002
1
6
1
6 ×
Vol
=
=
2
which means that the polygon is invisible.
If the observer is located at the origin, there is no need to create any vectors at all as the
volume is given by
x A
y A
z A
1
6
Vol
=
x B
y B
z B
x C
y C
z C
where only the coordinates of the vertices are required. Unfortunately, this determinant provides
a negative value for visible and a positive value for invisible.
 
Search WWH ::




Custom Search