Advertisement

making bone orientations relative to an inital pose

Started by November 26, 2002 02:55 PM
1 comment, last by BrianH 22 years, 2 months ago
Hello, This should probably be pretty easy, but I am wondering how I can take the local transforms of a set of bones and change them to be relative to an initial pose (just another set of local bone transforms). When I mean local bone transforms, I mean the position and rotation are given relative to the parent bone. Also, I have access to these transforms both as matrices and quaternions. Thanks in advance, BrianH
The relative rotation as a 3x3 matrix would be:

        [rel_xx rel_xy rel_xz]rel_R = |rel_yx rel_yy rel_yz]        [rel_zx rel_zy rel_zz] 


where each term is the dot product of one of the axes of the current pose basis vectors with one of the initial pose basis vectors. The first row, in this case, is the current pose x direction represented relative to the initial pose. Second row is the current pose y direction, etc. For reference, here''s a set of equations representing the complete matrix.

rel_xx = DotProduct(cur_xdir, init_xdir);
rel_xy = DotProduct(cur_xdir, init_ydir);
rel_xz = DotProduct(cur_xdir, init_zdir);
rel_yx = DotProduct(cur_ydir, init_xdir);
rel_yy = DotProduct(cur_ydir, init_ydir);
rel_yz = DotProduct(cur_ydir, init_zdir);
rel_zx = DotProduct(cur_zdir, init_xdir);
rel_zy = DotProduct(cur_zdir, init_ydir);
rel_zz = DotProduct(cur_zdir, init_zdir);

Note that cur_xdir, cur_ydir, cur_zdir are just the first, second, and third rows of the bone''s current rotation matrix, respectively. And init_xdir, init_ydir, and init_zdir are the first, second, and third rows of the bone''s initial pose rotation matrix.

Also note that these matrices may be transposed depending on which graphics API you use, e.g., rows and columns may be transposed.

Hopefully you can figure out the quaternion stuff.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Advertisement
Thanks!

This topic is closed to new replies.

Advertisement