I'm trying to use tutorial about movement to use keyboard to drive a truck. Truck model is taken from 3ds max (exportet to .3ds or .obj file).But when I'm trying to put it in the code from tutorial
scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/truck.3ds"));
after compilation window disappears. Model from 3DS max isn't animated so maybe it's something connected with add method. .3ds and .obj files are ok because I was able to load them, for example, in hello world tutorial.
I'll send more code if you want.
Thank you for any suggestions!
animating model from 3ds max
but it isn't animated and I can load it in this code:
int main()
{
IrrlichtDevice *device = createDevice( video::EDT_OPENGL, dimension2d<s32>(900, 700), 16,false, false, false, 0);
device->setWindowCaption(L"Przyklad dzialania Irrlichta ");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
IAnimatedMesh* mesh = smgr->getMesh("../../media/truck.3ds");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMD2Animation ( scene::EMAT_STAND );
}
smgr->addCameraSceneNode(0, vector3df(0,100,-100), vector3df(0,5,0));
scene::ICameraSceneNode * cam = smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
int main()
{
IrrlichtDevice *device = createDevice( video::EDT_OPENGL, dimension2d<s32>(900, 700), 16,false, false, false, 0);
device->setWindowCaption(L"Przyklad dzialania Irrlichta ");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
IAnimatedMesh* mesh = smgr->getMesh("../../media/truck.3ds");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMD2Animation ( scene::EMAT_STAND );
}
smgr->addCameraSceneNode(0, vector3df(0,100,-100), vector3df(0,5,0));
scene::ICameraSceneNode * cam = smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}