not show *.x animaton
Posted: Fri Apr 23, 2010 4:46 pm
I did animation and export to *.x file. I compile project, but nothing happen. I see only background. When i display normal model without animation all's ok. So why i don't see my model?
This is code(may help):
This is code(may help):
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
int main()
{
IrrlichtDevice* device = createDevice( EDT_OPENGL, core::dimension2d<s32>(640, 480),
32, false, true, false, 0);
video::IVideoDriver* video = device->getVideoDriver();
scene::ISceneManager* menage= device->getSceneManager();
scene::ICameraSceneNode *kam = menage->addCameraSceneNodeFPS();
device ->getCursorControl()->setVisible(true);
kam ->setPosition(core::vector3df(0,0,-100));
//Zasięg pola widzenia kamery
kam ->setFarValue(90000);
//Wczytywanie modelu
IAnimatedMesh* mesh = menage->getMesh("anim.x");
IAnimatedMeshSceneNode* pud = menage->addAnimatedMeshSceneNode( mesh );
pud -> setScale (core::vector3df(-300,-300,-300));
pud -> setPosition (core::vector3df(0,0,900));
pud ->setMaterialFlag(video::EMF_LIGHTING, false);
pud ->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
pud->setFrameLoop(0, 14);
pud->setAnimationSpeed(15);
int lastFPS = -1;
while(device->run())
{
video->beginScene(true, true, video::SColor(255,113,113,133));
menage->drawAll();
video->endScene();
int fps = video->getFPS();
if (lastFPS != fps)
{
wchar_t tmp[1024];
swprintf(tmp, 1024, L"Movement Example - Irrlicht Engine [%s] fps:%d",
video->getName(), fps);
device->setWindowCaption(tmp);
lastFPS = fps;
}
}
device->drop();
return 0;
}