• Advertisement
Sign in to follow this  

wrapping sphere around frustum

This topic is 1324 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was reading about frustum culling optimizations at flipcode and in that article, they wrap sphere around frustum and do a very cheap sphere-sphere intersection tests and if object is outside sphere, quicky reject or do again a frustum-box intersection to determine if object is really inside or outside frustum (for accuracy). Now I have some questions. This might be a stupid question but will i need to build sphere around frustum every frame (i think yes)? when i will build sphere around frustum, will it be in view space? (I think yes because frustum planes are in view planes.)

Share this post


Link to post
Share on other sites
Advertisement

Yes, you will need to rebuild it every frame (or at least every time that the camera changes, which is going to be most frames probably).

 

Given that the bounding sphere is going to be used for quick trivial rejection, I'd recommend taking the once-per-frame cost of transforming the sphere from view space to world space, as that'll be more convenient (i.e. faster) to use when you do your many hundreds of trivial rejection tests.

Share this post


Link to post
Share on other sites

If your sphere is built in camera space, you will not need to rebuild it, just multiply by the inverse view matrix(the camer'a world transform) to get it into world space.

Share this post


Link to post
Share on other sites

Given that for the purposes of intersection detection, a sphere is a centre point and a radius, the only sense in which you are "rebuilding" it is that you are moving the centre point each time. A sphere is four numbers, one of which would remain constant (the radius) in this particular application.

 

What exactly do you mean by "rebuilding" it?

Edited by Aardvajk

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement