
11.2 Linear Components and Polyhedra 495
the polyhedron or polygonal mesh is to be intersected many times (as in ray tracing,
for example).
Eric Haines (1991) describes an algorithm, based on the ideas of Roth (1981)
and Kay and Kajiya (1986), for convex polyhedra that is significantly faster than the
naive approach, an advantage due to the fact that he intersects the linear component
with the planes containing each face (which is relatively cheap), rather than with the
polygonal faces themselves (which can be quite expensive). The linear component is
L(t) = P + t
ˆ
d
and the planes of the faces are defined as
ax + by + cz + d = 0
Given these definitions, the distance from the linear component’s origin P and its
intersection with the plane P of a face of the polyhedron is
t
0
=
−(n · P + d)
n ·
ˆ
d
(11.6)
where n = [
abc
]is the plane normal of P. If the denominator of Equation 11.6
is (near) zero, then the linear component is parallel to the plane; in this case the sign
of the numerator indicates on which side of the plane the linear component’s origin
lies. Otherwise, the sign of the denominator indicates whether the linear component
has intersected the front of the plane or the back: if it is positive, then the plane
is intersected from the back (in terms of increasing t), and vice versa if the sign is
negative.
The idea behind Haines’s algorithm is this: the volume defined by a polyhedron
can be understood to be the logical intersection of the half-spaces defined by the
planes in which its faces lie. If we consider a linear component, its intersection with
a polyhedron consists of a portion of it that is entirely contained within the half-
spaces. The intersection of a linear component with each face’s plane partitions the
linear component into two regions—one that is “outside” the half-space defined by
that plane and one that is “inside” the half-space. From these facts we can conclude
that the portion of the linear component that intersects the entire polyhedron is the
logical intersection of the portions (of the linear component) that are within the half-
space defined by each face’s plane. This is illustrated (in 2D, for clarity) in Figure 11.7.
Note that we’ve not listed the half-lines in order of increasing edge index, but
rather in order of increasing intersection distance; this should make more evident
the nature of their logical intersection. Any line that intersects a polyhedron will first
intersect one or more “front faces” (if you consider the line “starting” at t =−∞)
and then some number of “back faces.” The logical intersection is bounded by the
last (farthest) front face and the first (nearest) back face.