Sign in to follow this  
Hnefi

Calculating offset on composite objects

Recommended Posts

Hnefi    386
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this