Calculating offset on composite objects

Started by
-1 comments, last by Hnefi 15 years, 11 months ago
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.
-------------Please rate this post if it was useful.

This topic is closed to new replies.

Advertisement