Recommended Posts

Hi,
I have a problem about multi animation.In direct x sdk there is a sample which shows multi animation (skinned animation) in .x files.It's working fine but when i change mesh (Tiny.x) with another animated mesh which i made the model is moving without control.Let's i show it on the code.
in the animate function in sample

The code shows how it set's the transform and rotation and orientation of the mesh.I mean (0,1,0) is the coordination of the mesh.
Here is my problem.When i change the animated mesh my new mesh is moving :)
It's not fixed in (0,1,0) position.The y position of the mesh getting increased.In every loop the coord increasing 1 unit.When i rechanged the mesh to tiny it's working fine.
Do you have any idea about it?
Thanks.

0

Share this post

Link to post

Share on other sites

maybe there is a problem with your .x file which makes it move forward with every step in the animation. Are you sure that code is the source of the problem? try increasing that 1 and see if it moves forward faster. When you set it negative does it move the other direction? Does the problem stop when its 0?

0

Share this post

Link to post

Share on other sites

That sample does two things. It runs that various animation sets in the Tiny_4anim.x file, but those animations do not actually move Tiny around the screen/world, and secondly it has a routine to actually make the various instances of Tiny move around the world when running the jog or walk animation sets. The animations by themselves do not move Tiny around, and she will just walk or jog in place at position (0,0,0) in the world.

The code you show will indeed cause a mesh to be translated by 1 up the y-axis every time it is called. It basically adds the +1 to the y to the current world matrix each time it is called. In the sample, moving away from you requires the mesh to be translated up the y-axis, since the platform is tilted upwards on the screen.

0

Share this post

Link to post

Share on other sites

The code you show will indeed cause a mesh to be translated by 1 up the y-axis every time it is called. It basically adds the +1 to the y to the current world matrix each time it is called. In the sample, moving away from you requires the mesh to be translated up the y-axis, since the platform is tilted upwards on the screen.

You are right but i am not changing the code,I am changing just the .x mesh file and my new skinned mesh's animations working fine.But it's position and rotation changing.

In both of the meshs (Tiny and my mesh) Animate function called in every loop, i checked it.