Code: Select all
int main(){
ISceneManager* sMgr = NULL;
IVideoDriver* vDrv = NULL;
ITexture* skyBoxTex = NULL;
IMesh* ufoGeom = NULL;
IMeshSceneNode* ufoInstance = NULL;
IrrlichtDevice* gameWindow = createDevice(EDT_DIRECT3D9, dimension2d<u32>(800,600),16,false,false,false,NULL);
if(!gameWindow)
return 0;
sMgr = gameWindow->getSceneManager();
vDrv = gameWindow->getVideoDriver();
if(!sMgr || !vDrv){
gameWindow->drop();
return 0;
}
skyBoxTex = vDrv->getTexture("uglySky.png");
ufoGeom = sMgr->getMesh("ufo1.obj");
/* +++ T H I S LINE WONT WORK ! ++ */
/* ... */
But when I tried to import the same Mesh (when in .obj format) the program crashes and Windows wants to search a solution for the problem.
I tested whether the .OBJ File contains wrong data (perhaps the export tool failed?) but all of these: C4D, Wings3D, Anim8or could import the .obj-Mesh without any problems.
Is it generally better to use the .3ds format instead of .obj? Do your irrlicht-programs crash too, when you try to import any .obj Meshes? (I usually prefered to export .OBJ - until today ...)