Alright if you have read some of my posts before I have been trying to load a X file format and get my animations working. So the update is some good news. I got the X file loaded and animations all play. Yeah. THX 2 ALL. But now the animation "Pops". There are three animations in the file below. Idle, Attacj, Walk. Idle loops fine. Everything works. But if you set the animation to Attact or Walk the loop pops after each loop and it seems to go to the main mesh where everything was defined. I tried it in the DX mesh viewer and these problems didnt happen. Now more strange things. I saved the animation out of the DX mesh viewer and then tried it (Zombie2.x). The last frame showing in the mesh viewer now became the stance the animation poped to. Yet the Idle animation still worked.
OK so heres the code
Code: Select all
scene::IAnimatedMesh* iZombieMesh = smgr->getMesh("Zombie2.x");
scene::IAnimatedMeshSceneNode* iZombieNode = smgr->addAnimatedMeshSceneNode(iZombieMesh, 0, -1, core::vector3df(0, 0, 0), core::vector3df(0, 0, 0), core::vector3df(200, 200, 200));
((IAnimatedMeshX*)iZombieMesh)->setCurrentAnimation("Walk");
iZombieNode->setAnimationSpeed(3200);
iZombieNode->setMaterialFlag(EMF_LIGHTING, false);
Here are the files.
http://www.jandrew.net/dean/Zombie.x
http://www.jandrew.net/dean/Zombie2.x
http://www.jandrew.net/dean/ZOMBIE.JPG
As always thanks a million. If you want you can also give me some ideas of another format I can use. Where I can make a model and addanimations and reference them by name and not by frame numbers.
Thanks