Graphics Reference
In-Depth Information
The cross-product operation is used to create a normal vector from two adjacent edges
selected from each surface. Any two will do, but the selection procedure must be the same for
all the surfaces, otherwise the normal vector will not point consistently inwards or outwards.
The chosen edges are the vectors u and v , as shown in Fig. 4.9.
By reversing one of them, say u , we can see that
n
=−
u
×
v
Furthermore, given a vector
n
=
a i
+
b j
+
c k
the plane equation is given by
ax
+
by
+
cz
=
ax P +
by P +
cz P
where x P y P z P is a point on the plane. Such a point is shown on each view in Fig. 4.9.
For example, in the first view,
u
=−
iv
=
jn
=
k P
=
000
therefore, the plane equation is given by z
=
0. These results are shown in the first row of
Table 4.1, followed by the other five surfaces.
The LHS of the plane equation returns a value of zero for any point on the plane; a positive
or negative value is returned for points not on the plane. If the point is in the space partition
occupied by the surface normal, a positive value is returned, otherwise it is negative.
Table 4.2 illustrates how the LHS expressions of the plane equations react to five different
points. With reference to Fig. 4.10, the point 2 2 2 is obviously inside the convex volume,
and all the expressions are positive, whereas the point 102 is outside the volume and the
expression
+
1 returns a negative value. Consequently, if any expression goes negative, the
search can halt and the point is declared outside.
If a point resides on one of the surfaces, the corresponding expression returns a zero value,
z
as shown with the point 2 1 2 . If a point resides on an edge, two expressions return a zero
value, as shown with the point 2 01. Finally, if a point resides on a vertex, three expressions
return a zero value, as shown with the point 111. The table entries that determine the final
result are shaded.
 
Search WWH ::




Custom Search