Jump to content
  • Advertisement
Sign in to follow this  
daObi

Bones and Hierarchy

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

Hi all, Currently i was coding on hierarchial representation an found a problem doing so!! I use left handed system, and represent rotations using quaternions and translation using vector. This is integrated into a class called Frame. The immediate representation of rotation is thru euler (vector) and another vector for translation. A bone object has these elem'nts , i.e. a immediate state and a frame object to represent its world state. When transforming a child bone using its parent's state I do the following: Bone::WorldTransform(Frame &parent) { Quaternion q; q.fromEuler(euler); wstate.orientation = q*parent.orientation; //the quaternion wstate.translation = parent.orientation.rotateVector(wstate.translation) + parent.translation; . . . } Since i'm using d3d I further convert this quaternion into matrix ( a 3x3 basis) and fill the last row of the matrix with the translation info. Now the problem is in my test prog the transformation doesn't seem to work. Not that joints are not displayed, Only x rotation is working properly other rotations bear wiered results. Further I have to use the conjugate of the Quat to get correct results (i.e. the only working x rotations) otherwise the joints are not displayed. My conversion from Quat to Matrix is wholly derived from few article infoes where right handed system with coloumn based format was used.I transposed the derived matrix as it should be. When the exprimentation failed, I negated the m(2,0),m(2,1),m(2,2), members as said in dx sdk reference. Even this doesn't prove right. What could the problem be! I am working on this for two weeks now and am frustrated. Any help will be much appreciated. -Obi

Share this post


Link to post
Share on other sites
Advertisement
Short:
LH is a mirror image of RH. So every angle if inversed.

Long:
Negating one axis, inevitably negates all cross-products calculated in the spatial system. Sinus is, by definition, calculated using cross-product. As cosinus is an "even function" (? don't know the english term), we can negate the angle used to calcualte it without consequences.
So we can simulate negation of cross-pr. by negating the angle.

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!