ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

TQ3ViewObject and Bounding Box Calculating Routines

Q: What effect does the TQ3ViewObject parameter have in the bounding-box calculating routines (Q3View_StartBounds and Q3View_EndBounds)? The old geometric-object routine descriptions refer to world space, but if this is the case, there is no need for a view parameter. However, if the view's camera is used, the bounding box is returned in camera coordinates, rather than view coordinates. Since both are useful, would it be possible to have both sets of routines available? I can apply a rotation/translation matrix to the whole of the items to be drawn to generate camera coordinates from a world coordinate routine, but I need to find out if I need to do this or if this has already been accomplished.

A: The bounding box/bounding sphere calculations are returned in world space. You can get the local space bounding box by simply making the world/local spaces identical, e.g., by not submitting any transforms.

Part of the reason the API was modified to use submit calls, rather than having separate pick, draw, and write calls, is that the transformations applied matter more than the camera. Since these modifications were made, the submit calls for everything (including transformations, if they are not stored in the group) can be in one function that is called from the Begin, End, write, pick, and draw calls. If you need the bounding box for a single geometry in its own coordinate space, this is also easy to do -- you can write a simple routine that performs bounds calculations on a single object. For example:


StartBoundingBox();
Object_Submit();
EndBoundingBox();

[Jun 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.