im writing a animationcontroller and fail to load animations using quaternions.
When i import the animation with matrixes it works fine.
So the reason have to be the quatertions..
This is the file:
|+ ID: 218 AnimationSet-Nr.: 3 'Animation_Run'
||+ ID: 219 Animation-Nr.: 39 controlls Bone 'Scene_Root'
|||- ID: 220 AnimationKeySet-Nr.: 115 TransformTyp=0 KeyFrameCount=96'
|||- ID: 221 AnimationKeySet-Nr.: 116 TransformTyp=1 KeyFrameCount=96'
|||- ID: 222 AnimationKeySet-Nr.: 117 TransformTyp=2 KeyFrameCount=96'
||+ ID: 223 Animation-Nr.: 40 controlls Bone 'root'
|||- ID: 224 AnimationKeySet-Nr.: 118 TransformTyp=0 KeyFrameCount=96'
|||- ID: 225 AnimationKeySet-Nr.: 119 TransformTyp=1 KeyFrameCount=96'
|||- ID: 226 AnimationKeySet-Nr.: 120 TransformTyp=2 KeyFrameCount=96'
..
..
[/qoute]Quote:
AnimationKey {
0;
96;
0;4;1.000000,0.000000,0.000000,0.000000;;,
1;4;1.000000,0.000000,0.000000,0.000000;;,
2;4;1.000000,0.000000,0.000000,0.000000;;,
3;4;1.000000,0.000000,0.000000,0.000000;;,
In my code i map this file to a quatertion like this:Quote:
pKeyData == 0;4;1.000000,0.000000,0.000000,0.000000;;,
qResult.v.x = ((float*)(pKeyData + sizeof(DWORD)*2))[1];
qResult.v.y = ((float*)(pKeyData + sizeof(DWORD)*2))[2];
qResult.v.z = ((float*)(pKeyData + sizeof(DWORD)*2))[3];
qResult.a = ((float*)(pKeyData + sizeof(DWORD)*2))[0];
then i apply the matrices in orginal order like:Quote:
matResult.SET_Identify();
for (DWORD dw1=1;dw1<pAnimation->dwCountKeySets;dw1++)
{
GetMatrixFromKeySet(matQuatertion[dw1])
matResult = matQuatertion[dw1]*matResult;
}
matBoneMatrix = matResult;
I just cant get it running :((
I wonder if i assign the data correct to the quatertion ?
[Edited by - KanTeH on December 6, 2010 1:43:08 PM]