Re: [Algorithms] Representing Animation Key Frame with Quaternion+Translation Vector
Brought to you by:
vexxed72
From: pontus b. <her...@ho...> - 2008-06-23 21:19:15
|
Intressting topic, how would you go about skinning a mesh using this kind of data? Is hardware skinning still an option? I assume matrix and vector operations are heavily optimized on current gpus. In the current solution I'm working with we keep the animation data as quaternions and vectors (all transforms relative the parent) in order to interpolate efficiently as well as perform blending operations. In the end we still convert them into matrices, then do a full hierarchy matrix mul before sending the matrices to the gpu. Pontus Date: Mon, 23 Jun 2008 13:01:52 -0500From: jas...@di...To: gda...@li...Subject: Re: [Algorithms] Representing Animation Key Frame with Quaternion+Translation Vector >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 p1wv = desired world vectorwv = 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,JHLim 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 onthat 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 isheavily overloaded in mathematics. -------------------------------------------------------------------------Check out the new SourceForge.net Marketplace.It's the best place to buy or sell services forjust about anything Open Source.http://sourceforge.net/services/buy/index.php_______________________________________________GDAlgorithms-list mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/gdalgorithms-listArchives: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 _________________________________________________________________ Ladda ner hela Windows Live gratis och upptäck fördelarna! http://get.live.com/ |