I have made a skeletal animation system that uses vertex blending. It works

with some animations I made in maya, but it outputs a mess of polygons with

tiny.x (actually tiny's head is recognizable). The only difference between

tiny.x and the .x files i made is that tiny.x stores the keyframes in matrix

form, whereas mine store seperate translation, rotation, and scaling info.

At this point I'm led to believe my code that breaks the matrix into its

translation, scaling, and rotation part is bad. Here it is:

if( keyType == 4 ) // RST-matrix

{

assert(numValues == 16);// matrix

D3DXMATRIX matrix = *((D3DXMATRIX*)dataPtr);

dataPtr += sizeof(D3DXMATRIX);

VectorKey T(timeInSeconds, matrix(3,0), matrix(3,1), matrix(3,2));

VectorKey S(timeInSeconds, 1.0f, 1.0f, 1.0f);

// Make sure row are unit length.

D3DXVECTOR3 r0( matrix(0,0), matrix(0,1), matrix(0,2) );

D3DXVECTOR3 r1( matrix(1,0), matrix(1,1), matrix(1,2) );

D3DXVECTOR3 r2( matrix(2,0), matrix(2,1), matrix(2,2) );

D3DXVec3Normalize(&r0, &r0);

D3DXVec3Normalize(&r1, &r1);

D3DXVec3Normalize(&r2, &r2);

matrix(0,0) = r0.x; matrix(0,1) = r0.y; matrix(0,2) = r0.z; matrix(0,3) =

0.0f;

matrix(1,0) = r1.x; matrix(1,1) = r1.y; matrix(1,2) = r1.z; matrix(1,3) =

0.0f;

matrix(2,0) = r2.x; matrix(2,1) = r2.y; matrix(2,2) = r2.z; matrix(2,3) =

0.0f;

matrix(3,0) = 0.0f; matrix(3,1) = 0.0f; matrix(3,2) = 0.0f; matrix(3,3) =

1.0f;

D3DXQUATERNION quat;

D3DXQuaternionRotationMatrix(&quat, &matrix);

QuatKey R(timeInSeconds, quat);

keyFrames->translations.push_back(T);

keyFrames->scalings.push_back(S);

keyFrames->rotations.push_back(R);

I think this will not work if there is significant scaling, but I looked atQuote:}

a few of the matrices at random and they seemed OK.