# Calculating a BB from frustum planes

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

## Recommended Posts

Hi, I have a set of frustum planes and I want to calculate an AABB around the frustum. I thought this would be simple but it is doing my head in :) Any ideas?

##### Share on other sites
You can either generate the 8 corners in clip space and use the inverse perspective/camera/world matrix to transform them into world space, or solve the three frustum plane equations for each corner point in world space directly.

##### Share on other sites
Thanks I am trying that, just one question, when calculating the matrix is it the (inverse perspective) * (camera) * (world) or is it inverse (perspective * camera * world) ?

##### Share on other sites
I think it is working, I ended up creating 8 clip points and transforming them by the inverse of the view matrix * the projection matrix (this is using Direct3D terminology). I then find the max and min values in that array and that defines my AABB. Like I say it **seems** correct although more testing needed. Thanks for the response.

##### Share on other sites
(just for reference)

These are equivalent:

(inverse projection) * (inverse camera)
inverse (camera * projection)

I can't remember the exact order D3D does it so you'd need to check the docs, the simplest way to ensure you're correct is to construct the exact matrix D3D is using and then just invert that.

##### Share on other sites
I should have remembered that :) It all seems to be working - thanks for your help.

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 11
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633755
• Total Posts
3013706
×