Jump to content
  • Advertisement
Sign in to follow this  

Calculating offset on composite objects

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

I'm trying to implement hierarchical OBB's for collision detection. I'm almost there, but some cases give very wrong results. It seems I'm having trouble calculating the offset of subobjects in the OBB hierarchy. So, could anyone help me solve this? Basically, the problem is this: I have an object O1 at position P1 and with a rotation matrix R. Both variables have known values. I need to find the world position P2 of a subobject O2, but I only know its offset from P1, which I will label D2 and which is known in O1's reference frame. IOW, if O1 is not rotated, P2 should be equal to P1+D2 (right?). But how do I apply the rotation matrix? I've tried doing P1 + R*D2, and I've tried P1 + D2*R, but neither give correct results. I don't want to assume the vector library is giving me bogus values until I'm positive that I've got the right formula. Any help will be much appreciated.

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!