Q3View_StartBoundingBox
You can use theQ3View_StartBoundingBox
function to start computing an object's bounding box.
TQ3Status Q3View_StartBoundingBox ( TQ3ViewObject view, TQ3ComputeBounds computeBounds);
view
- A view.
computeBounds
- A constant that specifies how the bounding box should be computed. See the following description for details.
DESCRIPTION
TheQ3View_StartBoundingBox
function begins the process of calculating a bounding box in the view specified by theview
parameter. After callingQ3View_StartBoundingBox
, you specify the model (for instance, by callingQ3Geometry_Submit
). When you have completely specified that model, you should callQ3View_EndBoundingBox
to complete the bounding operation. The renderer attached to the specified view might need to reprocess the model data, so you should always callQ3View_StartBoundingBox
andQ3View_EndBoundingBox
in a bounding loop.The
computeBounds
parameter determines the algorithm that QuickDraw 3D uses to calculate the bounding box. You should setcomputeBounds
to one of these constants:
typedef enum TQ3ComputeBounds { kQ3ComputeBoundsExact, kQ3ComputeBoundsApproximate } TQ3ComputeBounds;If you setcomputeBounds
tokQ3ComputeBoundsExact
, the vertices of the geometric object are transformed into world space, and then the world space bounding box is computed from the transformed vertices. This method of calculating a bounding box produces the most precise bounding box but is slower than using thekQ3ComputeBoundsApproximate
method.If you set
computeBounds
tokQ3ComputeBoundsApproximate
, a local bounding box is computed from the vertices of the geometric object, and then that bounding box is transformed into world space. The transformed bounding box is returned as the approximate bounding box of the geometric object. This method of calculating a bounding box is faster than using thekQ3ComputeBoundsExact
method but produces a bounding box that might be larger than that computed by the exact method.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help