//set textures path
smgr->getParameters()->setParameter(DMF_TEXTURE_PATH,"./data");
//choose if you want to use DeleD textures dirs (in this case no)
smgr->getParameters()->setParameter(DMF_USE_MATERIALS_DIRS,false);
//set alpha reference to your desidered value 0.01 works good.
smgr->getParameters()->setParameter(DMF_ALPHA_CHANNEL_REF,0.01f);
//flip alpha textures because of an Irrlicht trouble with tga files.
smgr->getParameters()->setParameter(DMF_FLIP_ALPHA_TEXTURES,true);
//load the map
IAnimatedMesh* mesh = 0;
mesh = smgr->getMesh("./data/mymap.dmf");
//add map to the scene
ISceneNode* node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
Thank u sir.
One more ques plz
I created a .x file and the problem wz same as with dmf file . So should i have to set directory for its textures also.
and if so , how can i set it
With .X files you don't need to set a path to its texture files as long as they're placed in the same folder as your X model, the model is properly textured and UV mapped and you have re-saved it in DX's Mview to make it Irrlicht comaptible:
i created a model in 3dsmx and exported it with panda . I textured model by assigning different id's to polygons and then applying the material.
Is that the correct way to do or do i have to change the way of texturing, the model wz not loaded.
best way would be to unwrap your model and create a single texture map for it instead of using 3dsmax's multi-layered materials since Irrlicht can't read them.
is it a static or animated model you're trying to export?
if it's a static one you could also try other 3d formats like 3ds or obj but the material part would still remain. Check 3dsmax's unwrapping tutorials.
yup it will, and you could also use Giles' My3d exporter (included in Irrlicht's "exporters" folder) to add lightmpas to it. This would be for static models of course (like levels).
afecelis wrote:best way would be to unwrap your model and create a single texture map for it instead of using 3dsmax's multi-layered materials since Irrlicht can't read them.
What do you mean with multi-layered materials? It's perfectly possible to use several textures for one mesh in 3ds and correctly display it with Irrlicht. What part is not working there? I know that advanced texture techniques like bump mapping are currently not supported, also texture tiling. But multiple textures are.
no but I can make one for you. Just give me 5
For instance; a cube with a different texture on each of its faces, like numers. That ok?
I'd export to .3ds and try it out myself first.
heheh, took me more than 5, sorry. I was grabbing something to eat
Ok, I'll report the My3d error. No multi-subobject materials are supported. Same process as before so you can check the Max5 file (ant the material created) and the 3ds. Then in Giles, it still loads the material ok but when exporting to My3d and running the app, the cube shows up totally black.
Hi ,
Your sintax is not correct, in fact your string has just one \, so the compiler will consider \r just like a command and will try to load a file called :"mapoom.dmf", that obviously doesn't exist. You should use:
"map\\room.dmf", if you want to use dos style path or better:
"map/room.dmf" to use unix like path.
This is the reason you get a file doesn't exist exception.
Anyway bye.