Everything with the default options. And yes, it looks quite similar to that case.
This is my code to load that model.
Code: Select all
scene::IAnimatedMeshSceneNode* meshLoaderWritter::loadModel(core::stringc s){
core::stringc currentPath = dev->getFileSystem()->getWorkingDirectory();
irr::scene::IAnimatedMeshSceneNode* model=0;
irr::scene::IAnimatedMesh* LoadedMesh = 0;
irr::scene::IMesh* Tmesh=0;
irr::scene::IAnimatedMesh* AMesh=0;
unsigned int i,j;
if(!smgr->getMeshCache()->isMeshLoaded(core::stringw(s.c_str()))){
LoadedMesh = smgr->getMesh(core::stringc(s.c_str()));
if(LoadedMesh){
Tmesh = smgr->getMeshManipulator()->createMeshWithTangents(LoadedMesh);
smgr->getMeshCache()->removeMesh(LoadedMesh);
}
if(Tmesh){
AMesh = smgr->getMeshManipulator()->createAnimatedMesh(Tmesh);
Tmesh->drop();
if(AMesh){
AMesh->getMesh(0)->setHardwareMappingHint(scene::EHM_STATIC,scene::EBT_NONE);
smgr->getMeshCache()->addMesh(core::stringw(s.c_str()),AMesh);
model = smgr->addAnimatedMeshSceneNode(AMesh,smgr->getSceneNodeFromId(0xFEE00000));
AMesh->drop();
}
}
}else{//The mesh was already there...
AMesh = smgr->getMesh(core::stringc(s.c_str()));
model = smgr->addAnimatedMeshSceneNode(AMesh,smgr->getSceneNodeFromId(0xFEE00000));
}
if(model){
dev->getFileSystem()->changeWorkingDirectoryTo(path);
for(i=0;i<model->getMaterialCount();i++){
model->getMaterial(i).MaterialTypeParam = 192;
model->getMaterial(i).AmbientColor=video::SColor(255,255,255,255);
model->getMaterial(i).AntiAliasing = antialiasing;
model->getMaterial(i).NormalizeNormals = true;
model->getMaterial(i).Lighting=true;
model->getMaterial(i).Shininess = 50;
model->getMaterial(i).setTexture(2,textIO->getTextureFile("nullnormal.bmp"));
model->getMaterial(i).setTexture(4,textIO->getTextureFile("shadowmap"));//The shadowmap rendertaget goes here!
for(j=0;j<8;j++){
model->getMaterial(i).TextureLayer[j].TrilinearFilter = true;
}
}
dev->getFileSystem()->changeWorkingDirectoryTo(currentPath);
}
return model;
}
I don't use any option to import that model.
Code: Select all
if(LoadedMesh){
Tmesh = smgr->getMeshManipulator()->createMeshWithTangents(LoadedMesh);
...
}
And the Irrlicht version i use is from the SVN (i don't remember which now, but from very little time ago, one month at most.)
The model is exported from 3DSMAX 2010 to an X file with the normals enabled, no optimizations and in binary mode uncompressed. I use the Panda DirectX exporter from here:
http://www.andytather.co.uk/Panda/direc ... loads.aspx
BTW, that is an static model, it has no animation.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt