Jump to content
  • Advertisement
Sign in to follow this  
B_old

Good way to check whether 2 frustums intersect

This topic is 4091 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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!