Jump to content
  • Advertisement
Sign in to follow this  
TheQuixotiC

Bounding Box of a moving mesh

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

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


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

Share this post


Link to post
Share on other sites
Quote:
Original post by evanofsky
Make 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 this post


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

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!