Sign in to follow this  

Updating of OBB's axis

Recommended Posts

Guys I really think this is silly but I have spend days on this and not been able to come out with a good solution. Please help me out and see if there is any logic errors in my code.. I have a OBB class which is simple defined as below... D3DXVECTOR3 Center; //center point of OBB D3DXVECTOR3 Halflength; //positive half length along its XYZ axis char * name; //name of this OBB D3DXVECTOR3 * orientations; //Local orientations (XYZ) The halflength are parsed in through a textfile which was done during the design stage of the OBB.. therefore the OBBs are all fixed in sizes. Now each OBB is so called attached to 2 joints of a skeleton, thus forming the bone. Therefore 2 more variables are added... D3DXVECTOR3 * jointAPos; //pointer to joint a pos D3DXVECTOR3 * jointBPos; //pointer to joint b pos All joints of the skeleton is capable of undergoing rotations and only the root joint can be translated. Now from the skinned mesh I can correctly update all the joints position, but the problem is how can I update the OBB so that it accurately represent the transformation that the bone it is attached to is going through? :( What I initially did was to use the positions of the 2 joints to form an axis of rotation, this can correctly track one degree of rotation but will have the problem of spinning. So I understand I need one more degree of rotation to correct this problem, but where should I add this? I have also tried to directly make use of the frame->transformationMatrix and apply to the local axis of each OBB but that too failed me.. Is there any example or tutorial similar to such a code? I am trying to attach OBB to the skeleton as if there were bones... Thanks again.. [edited] ... hehe silly me.. problem solved.. the parent matrix of my OBB joint A would be the correct one to apply to the axis.. :) [Edited by - eudora on March 28, 2006 7:18:56 AM]

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