624 Chapter 11 Intersection in 3D
// face-face intersection
ConvexPolygon F0Moved = C0.F(Cfg0.index[0]) + tfirst * W0;
ConvexPolygon F1Moved = C1.F(Cfg1.index[1]) + tfirst * W1;
FindPolygonIntersection(F0Moved, F1Moved, I);
}
} else {
// polyhedra were initially intersecting
ConvexPolyhedron C0Moved = C0 + tfirst * W0;
ConvexPolyhedron C1Moved = C1 + tfirst * W1;
FindPolyhedronIntersection(C0Moved, C1Moved, I);
}
}
The semantics of the functions for the moved convex objects are clear from the
function names.
11.12 Miscellaneous
This section covers a variety of intersection problems that do not fit directly into the
previous categories of the chapter.
11.12.1 Oriented Bounding Box and Orthogonal Frustum
The separating axis method, discussed in Section 11.11, is used to determine if an
oriented bounding box (OBB) intersects an orthogonal frustum. This is useful for
accurate culling of an OBB bounding volume with respect to a view frustum.
The oriented bounding box is represented in symmetric form with center C;
axis directions ˆa
0
, ˆa
1
, and ˆa
2
; and extents e
0
, e
1
, and e
2
. The axis directions form a
right-handed orthonormal system. The extents are assumed to be positive. The eight
vertices of the box are C +
2
i=0
σ
i
e
i
ˆa
i
,where|σ
i
|=1 (eight choices on sign). The
three normal vectors for the six box faces are ˆa
i
for 0 ≤i ≤2. The three edge direction
vectors for the twelve box edges are the same set of vectors.
The orthogonal view frustum has origin E. Its coordinate axes are determined
by left vector
ˆ
l, up-vector ˆu, and direction vector
ˆ
d. The vectors in that order form
a right-handed orthonormal system. The extent of the frustum in the
ˆ
d direction is
[n, f ], w he re 0 <n<f. The view plane is assumed to be the near plane,
ˆ
d · (X −
E) = n. The far plane is
ˆ
d · (X − E) = f . The four corners of the frustum in the
near plane are E ± 4
ˆ
l ± µ ˆu + n
ˆ
d. The four corners of the frustum in the far plane
are E +(f/n)(±4
ˆ
l ±µ ˆu +n
ˆ
d). The five normal vectors for the six frustum faces are
ˆ
d for the near and far faces, ±n
ˆ
l −4
ˆ
d for the left and right faces, and ±n ˆu − 4
ˆ
d for
the top and bottom faces. The six edge direction vectors for the twelve frustum edges