# Good way to check whether 2 frustums intersect

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

## 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 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 on other sites
You could also check if there are planes that are intersecting, this can be done quickly with halfspaces.

##### 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 on other sites
Quote:
 Original post by daniel_i_lYou 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 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 on other sites
Quote:
 Original post by oliiiyou 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.

1. 1
2. 2
3. 3
Rutin
18
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633659
• Total Posts
3013216
×