views:

90

answers:

0

I am attempting to implement a skeletal animation setup within a game engine I am currently coding for my practicum at school. The engine is coded in c++ and directx 10 using a right handed system.

Currently I am using collada for importing and loading meshes (I know it's not the best solution available). The setup I am using uses quaternions for rotations which I convert to matrices just before passing the data off to the gpu for gpu skinning. I am using softimage for building test meshes to test various aspects of the animation code.

The issue I am having is when it comes to the rotation values. I am using D3DXQuaternionRotationYawPitchRoll to convert the rotation values over from euler angles to quaternions. Problem with this is that currently the animations are on the wrong axis. what should be a rotation around the y-axis is a rotation around the x-axis. For it to animation properly, I have to swap the x and y values and negate the y value. This is on just a simple extruded box with branches. For each animated bone I am currently calculating it's local transformation matrix (rotation matrix multiplied by translation matrix) which I then multiply parent matrix by the current local matrix to get the final transformed matrix relative to it's parent.

Is there some secret to handling collada rotations properly? everything I have checked shows the values are correct before multiplying each bone by the parent. Swapping the order of the matrix multiplications hasn't made any noticeable improvement. Any help is greatly appreciated, in the mean time I will work on other sections of the engine as I have spent too much time currently running in circles.