FAST AABB/View-Frustum Overlap Test
Kenny Hoff
last updated on 1/24/97
Overview of the Algorithm:
We are assuming the viewing frustum is unbounded (no near or far plane)
defined by a set of four planes that all intersect at the center-of-projection,
and that we are using Axis-Aligned Bounding Boxes (AABBs).
-
Trivial Rejection or Acceptance of AABB
-
Using the Box/Plane overlap test for AABBS as described here,
test against each plane of the frustum. If the AABB is outside of any of
the planes then immediately trivially reject (completely out). If the AABB
is inside ALL of the planes then trivially accept (completely in).
-
View-Frustum Edge Tests Against the AABB
-
We begin testing each of the four edges of the frustum (which are actually
projector rays emanating from the center-of-projection through the corners
of the viewplane window) is for intersection against the AABB. If any edge
intersects then the AABB partially overlaps (partial).
-
To make the intersection test more efficient, we exploit the axis-alignment
and symmetry of the AABB. We treat the AABB as a set of three "slabs" (Kay/Kajiya)
where each slab is a pair of parallel planes. By keeping track of the "in"
and "out" hit times, we quickly determine if the edge intersects or not.
-
AABB Edge Tests Against the View-Frustum
-
We begin testing each of the eight edges of the AABB is against the view-frustum.
Just as before, if any edge intersects, then the AABB partially overlaps
(partial).
-
We attempt to make this a little more efficient by treating the view-frustum
as a convex-solid defined by the intersection of a set of half-spaces formed
by view-frustum side planes. We can then use the typical ray-convex solid
intersection test used by most ray-tracers. This is not particularly fast,
but it does allow for early termination.
Source Code: