Basic animation help - 3ds
Posted: Wed Apr 21, 2010 7:32 am
Hi, I've created my first animation in 3ds max with a biped, which looks lame, but loops nicely in 3ds max studio. It's a start. I've exported the file to .3ds format and referenced it in the code below. The problem I have is this - when I run my irrlicht proj, all I see is my biped character just standing there, as he looks in frame 1 from within 3ds max. So the animation is obviously not being invoked correctly. Are there any obvious problems with my code?
Also, note my reference to createFlyStraightAnimator. As you can probably guess this is my very lame way of getting the camera to sit still at a particular spot. I've justmodified example code. What's the right way to achieve a camera in one static location?
Also, note my reference to createFlyStraightAnimator. As you can probably guess this is my very lame way of getting the camera to sit still at a particular spot. I've justmodified example code. What's the right way to achieve a camera in one static location?
Code: Select all
scene::IAnimatedMeshSceneNode* anms =
smgr->addAnimatedMeshSceneNode(smgr->getMesh("animation.3ds"));
if (anms)
{
scene::ISceneNodeAnimator* anim =
smgr->createFlyStraightAnimator(core::vector3df(0,-20,50),
core::vector3df(0,-20,50), 3500, true);
if (anim)
{
anms->addAnimator(anim);
anim->drop();
}
anms->setMaterialFlag(video::EMF_LIGHTING, false);
anms->setFrameLoop(1, 200);
anms->setAnimationSpeed(15);
anms->setScale(core::vector3df(2.f,2.f,2.f));
}
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
gui::IGUIStaticText* diagnostics = device->getGUIEnvironment()->addStaticText(
L"", core::rect<s32>(10, 10, 400, 20));
diagnostics->setOverrideColor(video::SColor(255, 255, 255, 0));*/
int lastFPS = -1;
u32 then = device->getTimer()->getTime();
const f32 MOVEMENT_SPEED = 5.f;
while(device->run())
{
//key stroke check code removed for brevity
}