# Bounding Box of a moving mesh

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

## Recommended Posts

When I use D3DXComputeBoundingBox,I get min and max corners of box,but the mesh is moving and I can not use those corners to find if the ray intersects with the bounding box of the mesh. When object moves,which process should I apply to corners? [Edited by - Coder on June 17, 2005 10:57:50 AM]

##### Share on other sites
min += move, and max += move

Maybe I'm missing something though.

##### Share on other sites
Make a temp vector for each of the min/max variables, then multiply those temp vectors by the object's world transformation matrix.

##### Share on other sites
Quote:
 Original post by evanofskyMake a temp vector for each of the min/max variables, then multiply those temp vectors by the object's world transformation matrix.

This isn't enough if you are using an arbitrary transformation matrix (with rotation, etc). You need to find the 8 corners of the AABB (ie. every permutation of the two 3-tuples), transform them by the world matrix, then reform a new AABB around the 8 transformed points. This will, of course, enlarge your box and it will no longer fit tightly, but otherwise you'd have to transform each of the contained vertices (yikes!) and recalculate the AABB. Oriented bounding boxes solve the latter problem (trasforming them maintains a tight fit), but are computationally more expensive.

##### Share on other sites
Hi,
We have two methods to check collisions. First, we use a BB that easilly encloses our model. Second, we use a medium (2000 polys) model for rendering a a very low (300 polys) model for collision detection/shadows/reflections in order to save time. The low poly model uses the same matrices than the original model so it mimicks the positions of the original model. Usually we mix both techniques for the final result. That frees us about using aligned BB which are harder to maintain and the engine keeps simple.

May be that helps you.

Luck!
Guimo

• ### What is your GameDev Story?

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

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634059
• Total Posts
3015296
×