Jump to content
  • Advertisement
Sign in to follow this  
pauljan

Deriving OBB transform from 8-point notation

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

So here I have 8 vertices (I actually have face information too), as drawn by the artist... all in world coordinates. From this I need to derive the Collada OBB collision volume, meaning I need a translation, rotation and half-extents. Rotation is to be expressed as up to three rotations around arbitrary axes. For an AABB this is easy enough, but deriving the rotation for a non-aligned BB is causing me a bit of a headache. Any pointers would be very much appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Take one vertex and its adjacent vertices. Subtract the first vertex from the others and normalize the results to get the columns of a rotation matrix (which can be converted into axis and angle if needed). When normalizing, save the length of the vectors and divide them by two to get the extents. Also multiply the normalized vectors by their corresponding extends and add them to the first vertex to get the center.

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!