Jump to content
  • Advertisement
Sign in to follow this  
Guoshima

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


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


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

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!