Archived

This topic is now archived and is closed to further replies.

steg

Bounding Spheres

Recommended Posts

steg    390
Hi, I was wondering when calculating a bounding sphere for an object would you precompute it before hand ? Also, would you use an average radius or maximum ? Thanks, sTeVe

Share this post


Link to post
Share on other sites
thedo    124
Precompute it before hand - any overhead while rendering is bad.
D3DX has a function to compute a bounding sphere from a Vertex Buffer. To make sure it is drawn if in the viewing frustrum you would have to make sure that you use the MAXIMUM radius. Imagin if a few points are out of the sphere the you would be back to square one with objects not being drawn at the edge of your frustrum.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
steg    390
Thanks Thedo,

I have heard though that the average method is quicker - a certain Andre Lamothe book mentions it ?!

You would have thought DX8 would have had a get frustum method in it - how do you get the 6 planes of the viewing frustum ?

Thanks
sTeVe

Share this post


Link to post
Share on other sites
DrunkenHyena    805
G''day!

Once you pre-compute it, whether you use average or maximum, the calculations are the same, so I don''t see any reason that using the average would be faster from that perspective.

If you use the average, more objects will be rejected so that will be faster, but with odd shaped objects you may end up rejecting objects that should be visible.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites