Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 13 - View Objects / View Objects Reference
View Objects Routines / Bounding in a View


Q3View_StartBoundingSphere

You can use the Q3View_StartBoundingSphere function to start computing an object's bounding sphere.

TQ3Status Q3View_StartBoundingSphere (
TQ3ViewObject view, 
TQ3ComputeBounds computeBounds);
view
A view.
computeBounds
A constant that specifies how the bounding sphere should be computed. See the following description for details.
DESCRIPTION
The Q3View_StartBoundingSphere function begins the process of calculating a bounding sphere in the view specified by the view parameter. After calling Q3View_StartBoundingSphere, you specify the model (for instance, by calling Q3Geometry_Submit). When you have completely specified that model, you should call Q3View_EndBoundingSphere to complete the bounding operation. The renderer attached to the specified view might need to reprocess the model data, so you should always call Q3View_StartBoundingSphere and Q3View_EndBoundingSphere in a bounding loop.

The computeBounds parameter determines the algorithm that QuickDraw 3D uses to calculate the bounding sphere. You should set computeBounds to one of these constants:

typedef enum TQ3ComputeBounds {
   kQ3ComputeBoundsExact,
   kQ3ComputeBoundsApproximate
} TQ3ComputeBounds;
If you set computeBounds to kQ3ComputeBoundsExact, the vertices of the geometric object are transformed into world space, and then the world space bounding sphere is computed from the transformed vertices. This method of calculating a bounding sphere produces the most precise bounding sphere but is slower than using the kQ3ComputeBoundsApproximate method.

If you set computeBounds to kQ3ComputeBoundsApproximate, a local bounding sphere is computed from the vertices of the geometric object, and then that bounding sphere is transformed into world space. The transformed bounding sphere is returned as the approximate bounding sphere of the geometric object. This method of calculating a bounding sphere is faster than using the kQ3ComputeBoundsExact method but produces a bounding sphere that might be larger than that computed by the exact method.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help