AdvanceTime does not update root frame matrix??

Started by
0 comments, last by diablo2_v 17 years, 8 months ago
So I coded up an animation example in directX, closely following the SDK's MultiAnimation example. Recently, I made an animated, skinned model in Max 7 and exported it with Panda Exporter. The DX Mesh Viewer shows the model skinning and animating correctly. When I try to place it in my program though, it shrinks to a point on the screen in only a few frames. I am using a world matrix that scales all coordinated by half as my base matrix for my updateFrames function::

        assert(pFrame != NULL && baseMat != NULL);

	D3DXMatrixMultiply(&pFrame->TransformationMatrix, &pFrame->TransformationMatrix, baseMat);

	if (pFrame->pFrameSibling)
		UpdateFrames((MeshFrame*)pFrame->pFrameSibling, baseMat);
	if (pFrame->pFrameFirstChild)
		UpdateFrames((MeshFrame*)pFrame->pFrameFirstChild, &pFrame->TransformationMatrix);

However, when I look at the frame palette that is generated after each frame, it looks as if AdvanceTime is not in fact updating the root frame (it just keep shrinking). I don't know what to do. It works perfectly with Tiny... Has anyone ever seen this before? Also, I know that my mesh is animating becuase I can see the mesh updating in PIX (August 2006), it's just shrinking like crazy.
Advertisement
I am in no way an expert with skinned meshes at all, but you could try using another matrix in your derived frame to represent the combined matrix. You would then multiply the transformation matrix with the parent matrix, and store it in the combined matrix.

ie.
D3DXMatrixMultiply(&pFrame->CombinedMatrix, &pFrame->TransformationMatrix, baseMat);


It sounds like you are compounding the scaling each frame. So on the first frame it would be 1/2 size, the second it would be 1/4, third would be 1/8 etc.

Before you try this though, try using tiny, and make her 1/2 the size like you are doing now.

I'm not sure if this will solve your problem or not, but it may lead you in the right direction.
'Programming is the only artform that fights back'

This topic is closed to new replies.

Advertisement