Sign in to follow this  
B_old

Good way to check whether 2 frustums intersect

Recommended Posts

Hi, I want to check whether to (view)frustums intersect. I have found some code that does the test. It uses the 8 corner points of each frustum. Currently I only store the 6 planes for each frustum, and all intersection tests worked with them. So now I am wondering what you use to make such a test? [Edited by - B_old on April 9, 2007 12:58:00 PM]

Share this post


Link to post
Share on other sites
Does it have to be accurate? For best accuracy and speed, I'd use the SAT. Although you have to be careful, with the size of the volumes, you'd run into some possibly serious quantisation problems. Floating point number accuracy has its limits, and if you do the basic SAT test, it will square potentially large values. But there are ways round that. Namely, store the edge directions as normalised vectors and use that.

Share this post


Link to post
Share on other sites
That's what the SAT does in essence. The first few tests is basically telling you if one of the frustum intersects the planes of teh other one. Then the test gets refined by testing the planes resulting from the edge cross products for extra accuracy. That part can be ignored if you just want a fast but loose test.

Share this post


Link to post
Share on other sites
Quote:
Original post by daniel_i_l
You could also check if there are planes that are intersecting, this can be done quickly with halfspaces.

Do you mean to check whether one of the frustums planes intersect with the other frustum or with any of the other frustums planes?

Share this post


Link to post
Share on other sites
you check the vertices of the frustum against the planes of the other frustum. If you find a case where all vertices lie on the the 'outside' side of a plane, then there is no intersection possible.

Share this post


Link to post
Share on other sites
Quote:
Original post by oliii
you check the vertices of the frustum against the planes of the other frustum. If you find a case where all vertices lie on the the 'outside' side of a plane, then there is no intersection possible.

Thanks, that makes sense.
I actually tried it, and it seems to work quite well. Doesn't even so terribly slow to me either.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this