2d bbox of an object

2d bbox of an object

Post by Mann » Sat, 12 Sep 1998 04:00:00

Well, this isn't a clever solution, but it works:

Using gluProject again, transform the entire object
That'll get you the full set of 2d vertices
which you can use to calculate the 2d bounding box

This might work for the actual sphere, assuming you have a bounding
sphere center and radius when you start:

Manually transform the center point with just the modelview matrix.
Then add the radius to the X of the center point.  Then gluProject
with an identity modelview matrix those 2 points.  They should end up
still with the same Y value, and the difference in X as the new

Seems like there ought to be some clever solution to this, though.
Perhaps manually transforming the center point using just the two
matrices (not gluProject) - that will give you the W coordinate - then
divide the radius by the W coordinate?



>Is there anything similar I can use to answer my other query.  ie: How
>can I determine the visible pixel size of a sphere, so that I can make
>my target thingy the right size?

>Ian 'DrDebug' Day
>Author of MrDebug


1. Performer BBox's

Performer Question:
  In the man page for pfNodeBBox, I see that "Currently, nodes use spheres
as the default bounding volume.  This may change in a future release."

So what are the alternatives to spheres? I would prefer to use a box. And
what calls do I need to set up an alternative bounding volume?

I notice that for GeoSet's that a box appears to be the default bounding
volume. It's not clear why these should be different. It's quite unexpected.

Bill Myers

2. Simple Text animator with FLC output.

3. bbox-fit polygon generation

4. A question..

5. Corrected Rectangle from BBox and Theta

6. Ray (or line) NEAR object

7. Clipping BBox against BSP?

8. Flame Add-In for 3DS2???

9. Checking bbox with frustum

10. Q: A-Aligned BBox

11. 3D BBox Intersection

12. extrusion of 2D image to form 3D object

13. rotate 2d objects?