Jump to content
  • Advertisement
Sign in to follow this  

Updating of OBB's axis

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

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
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!