Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Skinning

Started by maya18222 Apr 15, 2009 at 3:54 PM 0 replies 600+ views
Original Post
maya18222
maya18222
Im currently working with files that have the matrices for the bind pose and each frame of animation for every bone. I gather this is not the advised method due to the amount of memory required to that of quaternions. But it will suit me for the time being. I have a few questions though. 1. In the book, 3d math Primer, the author mentions its impossible to interpolate between matrices. But i dont see how this is so, what is wrong with: -Get the matrix of current bone, for the current frame, and the next frame -Get a vector, by subtracting row1 of matrix *current* from row1 of matrix *next* -interpolate *this* matrix row1 over that vector by some time variable -do for all 4 rows -normalise each basis vector 2. Whether interpolating between quaternions/euler angles or matrices. When doing the interpolation between the frames, is this best done on the CPU or on the GPU? For example, if im between frame 2 and 3 for some particular bone. Is it best to send both matrices to the card, and interpolate there? or is it usually done on the CPU, and just send the resulting matrix? 3. Is the quaternion method only used for storage purposes? or is that the technique they use for the skinning process too? If so, would'nt the conversion for each bone every frame be more taxing than just working with matrices anyway?
bzroom
bzroom
1.) You can't slerp an orthogonal matrix by lerping the basis vectors, it will skew and go flat if the rotation is 180degrees. Slerp the quaternions.

You can see an example of that in this video: around 1:48 when he gets in the vehicle youll see him almost go flat. Also watch when the ragdolls are rising from the dead. It's just interpolating the model transform by the method you described, in most cases you'll see them "fold inside out." If i would have converted the transform to a vector and quaternion and interpolated those, it would have been a lot better result. The last few seconds of the video show the artifact the best.
http://video.google.com/videoplay?docid=-652689048723007001

2.) I'd recommend doing this on the CPU. It will allow you to scale easier, eventually having very complex sources of interpolation. While maintaining a simple interface (only the final matrices) with the graphics.

3.) Quaternions are used for their small storage size but most imporantly for their slerp-ability. You may do all kinds of operations with your quaternions, ultimately converting them to a matrix will be a smaller portion of the cost.

[Edited by - bzroom on April 15, 2009 4:59:55 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.