Re: [Algorithms] Representing Animation Key Frame with Quaternion+Translation Vector
Brought to you by:
vexxed72
From: Jason H. <jas...@di...> - 2008-06-23 18:02:00
|
From what you're asking, if you want to transform a relative-space vector from the leaf node, you do something like this: rv = relative to p1 wv = desired world vector wv = p0 + -q0 * (p1 + -q1 * rv) = p(n-1) + (-q(n-1) * v) ... You simply need to invert the quaternions (negation) to transform the opposite direction. Transforming a point is just loading a quaternion with XYZ0 and doing a quaternion multiply, if I recall correctly. Since each node has translation relative to its parent, you add that after you transform the point into the parent space. Of course, you'll want to look over the Matrix and Quaternion FAQ for the exact math for it. It's sufficient for a layman to get the code working. Note that the above configuration is completely incompatible with scale, unless you allow non-unit quaternions and can wrangle that beast... Hope that helps, JH Lim Sin Chian wrote: > Thanks for the replies, guys. > > Suppose I have a hierarchy with 2 connected bones. One of them (bone0) > is the root, the other (bone1) is the child. > > Say bone0 has transformation T0 (q0, p0) and bone 1 has T1 (q1, p1), > where q0, q1 are quaternions representing modelling space rotation, > and p0, p1 are vectors representing modelling space translations. > > To compute the world space orientation for bone1, I would do the > following: > q1World = qWorld X q0 X q1; > > I am really interested to find out if there is a similar way to > compute the world space translation for bone1. > > Thanks! > > > */"Marc B. Reynolds" <mar...@or...>/* wrote: > > > > > Is "study parameter" a typo there? I couldn't find any google > hits on > that phrase. > > Try "study parameters", with an additional key, such as: > kinematics, screw, wrench, twist, robotics, etc. > > Some works use "Study parameters" to replace the "dual", since dual is > heavily overloaded in mathematics. > > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > ------------------------------------------------------------------------ > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |