Jump to content
• Advertisement

# Frustum AABB intersection

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

Hello, I have a little math problem. Can someone help me with a method which scales down an AABB so it fits inside a given frustum. My AABB is basically defined as: D3DXVECTOR3 minPt; D3DXVECTOR3 maxPt; While the frustum has: D3DXVECTOR3 pntList[8]; D3DXPLANE camPlanes[6]; int nVertexLUT[6]; thx, Kenzo

#### Share this post

##### Share on other sites
Advertisement
Find the center point of the AABB, find the distance to all 6 planes, then find the closest distance.

Now do a ratio scalling where the AABB Point furtherest from the center is scaled to equal this now distance

float distance;
vector Center = (minPt+MaxPt)/2;
for (int f=0;f < 6;f++)
if (GetPlaneDistance(plane,center)) distance = GetPlaneDistance(plane,center);

Resize the AABB to fit into the Sphere Center with Radius = Distance

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5
• Advertisement

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633695
• Total Posts
3013374
×

## Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!