# How to get the frustum bounding box?

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

## Recommended Posts

Hi all, once i have the normal and the distance of my 6 planes that define the frustum, how can i get the frustum bounding box? Thanks Kev

##### Share on other sites

Search for "frustum culling"

Here is the first hit:

http://www.flipcode.com/articles/article_frustumculling.shtml

Happy Coding...

##### Share on other sites
Thanks for the info, but in that article the author calculate the frustum bounding sphere, and i need the frustum bounding box.
How can i get the min and max points of the frustum bounding box?

Thanks again

##### Share on other sites
Axis-aligned? If so, just find the minimum and maximum range of your object. In most cases, this is vertex positions. Find the vertex with the lowest x coordinate. That x is your box left coordinate. The highest x coordinate is the box right coordinate. etc. That's all there is to it, until you start rotating things. That's why the article used a sphere. Sphere's are also way faster to reject.

##### Share on other sites
If you only want an axis aligned bounding box of the frustum in worldspace, then you don't need the frustum planes.

You can get each of the 8 corner points of the worldspace frustum by multiplying the eight corner points of the clip space unit cube with the inverse view-projection matrix iP:

Point 1 = (-1, -1, -1, 1) * iP
Point 2 = (1, -1, -1, 1) * iP
Point 3 = (1, 1, -1, 1) * iP
Point 4 = (-1, 1, -1, 1) * iP

Point 5 = (-1, -1, 1, 1) * iP
Point 6 = (1, -1, 1, 1) * iP
Point 7 = (1, 1, 1, 1) * iP
Point 8 = (-1, 1, 1, 1) * iP

These points will form the common flat pyramid shape. Now get the minimum and maximum for each axis at each point, and you have bounding box.

##### Share on other sites
Thanks very much Yann for the info :)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 17
• 14
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634097
• Total Posts
3015505
×