# Thread: Interpolating Matrices for Skinned Animation

1. ## Interpolating Matrices for Skinned Animation

Hi,

I have a question about interpolating matrices for skinned animation in COLLADA.

I was planning to convert the rotational part of each matrix to a quaternion and the translation part to a vector.

Given a time value in the animation time range, I was going to find the interval in which the time value lies, SLERP the quaternions that represent the rotations of the matrices, then LERP the translation vectors and recombine the result into a matrix.

However, I noticed that one of the <animation> elements targets element (3)(3) of a matrix for a joint, and this is usually 1 in an orthogonal system.

Is this valid? How is this supposed to work? If I do have to consider this <animation> element correct, then how do I interpolate the matrices?

Do I use a quaternion SLERP for the rotations, a LERP for the translation and a LERP again for row 3 (i.e., the last row with 0 based indexing as in the COLLADA spec) of the matrix?

2. It seems strange that that element of the matrix is being targeted for animation. Where'd that model come from?

3. That sounds possibly like the result of a bug that was fixed in ColladaMax 3.04E, unless it came from somewhere other than an older Max exporter.

http://www.feelingsoftware.com/bugzi...bug.cgi?id=508

4. ## Re: Interpolating Matrices for Skinned Animation

Originally Posted by hughel
I was planning to convert the rotational part of each matrix to a quaternion and the translation part to a vector.
Is that one-to-one? The splitting of a matrix into translation, scaling vectors and rotation angles is able to produce an infinite amount of possibilities, isn't it? But I am not sure if a conversion of a 3x3 matrix to a quaternion and back is one-to-one.
That is not COLLADA specific but would help us a lot, because we have problems with character animations from Maya*, if we do not bake the data into transformation matrices. But matrices can not be blended the easy way like two rotation angles or three translation vectors. And a linear interpolation between two matrices seems to be like a linear interpolation between two morph targets, which can shorten body parts, if the poses are obvious different.

(* That is no problem of the Feeling Software exporter but an internal one with the rigs our artists are using. After baking from IK the bones are rotating unintentionally between full frames sometimes.)

5. I'm using this method right now and I don't seem to have any problems.

I don't see how any other way of interpolating between matrices from a COLLADA file is possible.

I know that ColladaMax will always export skinned animations as baked matrices, so you won't have the angles of rotation, scaling values, etc for each keyframe.

And if it works for the matrices in a COLLADA file, then I don't see why your character animations from Maya wouldn't work too.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•