Re: [Algorithms] Representing Animation Key Frame with Quaternion+Translation Vector
Brought to you by:
vexxed72
From: Jon W. <jw...@gm...> - 2008-06-23 21:31:35
|
pontus birgersson wrote: > > 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. Yes, you can still hardware skin. In fact, you can do more bones per pass, because offset+quaternion is only 2 constant registers, whereas a matrix is at least 3 constant registers. The code to transform a vertex by a quaternion is slightly more expensive than the code to transform by a matrix, as is the code to blend quaternions, but it will still fit in a shader model 2 vertex shader. > > 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. We do the same thing, except we do the hierarchy multiplication in quaternions/offsets, and only convert to matrices when sending to the card (as 3x4 mats). It's a decent compromise. Sincerely, jw |