Q3View_StartBoundingSphere
You can use theQ3View_StartBoundingSpherefunction 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
TheQ3View_StartBoundingSpherefunction begins the process of calculating a bounding sphere in the view specified by theviewparameter. After callingQ3View_StartBoundingSphere, you specify the model (for instance, by callingQ3Geometry_Submit). When you have completely specified that model, you should callQ3View_EndBoundingSphereto complete the bounding operation. The renderer attached to the specified view might need to reprocess the model data, so you should always callQ3View_StartBoundingSphereandQ3View_EndBoundingSpherein a bounding loop.The
computeBoundsparameter determines the algorithm that QuickDraw 3D uses to calculate the bounding sphere. You should setcomputeBoundsto one of these constants:
typedef enum TQ3ComputeBounds { kQ3ComputeBoundsExact, kQ3ComputeBoundsApproximate } TQ3ComputeBounds;If you setcomputeBoundstokQ3ComputeBoundsExact, 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 thekQ3ComputeBoundsApproximatemethod.If you set
computeBoundstokQ3ComputeBoundsApproximate, 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 thekQ3ComputeBoundsExactmethod but produces a bounding sphere that might be larger than that computed by the exact method.