Graphics Reference
In-Depth Information
Figure 6.3.
Combining bounding boxes.
Figure 6.4.
Bounding spheres.
terms of the d near and d far of the primitives that define it. For example, to get the d near
and d far of the union of two objects X and Y , we need simply take the minimum of
the two given d near and the maximum of the two given d far . See Figure 6.3.
Finding the intersection B of two generalized bounding boxes B 1 and B 2 (defined
with respect to the same set of normal vectors) is not hard. The formulas are really
the same as those for boxes. The only difference is that instead of taking maxima and
minima of coordinates (the orthogonal projections onto the standard axes e i ) we now
take maxima and minima of the orthogonal projections onto the normals n i , that is,
(
)
(
)
near
near
near
far
far
far
() =
()
( )
() =
()
( )
d
B
max
d
B
,
d
B
and
d
B
min
d
B
,
d
B
.
(6.3)
i
i
1
i
2
i
i
1
i
2
The generalized boxes B 1 and B 2 are disjoint if and only if d far ( B ) < d i near ( B ) for some
i.
Other common types of bounding object are circles or spheres (we shall use the
generic term “sphere” to refer to both). Such bounding spheres are also easy to deal
with and may fit the objects better. See Figure 6.4. Two spheres S i with centers c i and
radii r i will intersect if and only if
(
)
cc
-£+
rr.
1
2
1
2
Finding the appropriate bounding sphere for an object is usually not hard if done by
hand. Automating the process is not quite so easy. It involves finding the smallest
Search WWH ::




Custom Search