Sign in to follow this  

How to get the frustum bounding box?

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

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

This topic is 4583 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.

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