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