Sign in to follow this  
daObi

Bones and Hierarchy

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

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