Page 1 of 1

*SOLVED* 3ds texture problem

Posted: Wed May 04, 2005 9:54 am
by IllegalEnzyme
Hi,

i'm having a problem with my textures on a 3ds model, heres my problem:

i've assigned different textures to different parts of the model, there are three textures, i load the model and the console window tells me that all three textures have been loaded correctly, however, all the polygos in the model are rendered in the first texture, the other two don't show up at all.

Can anyone help?

Thanx in advance, IE

Posted: Wed May 04, 2005 12:10 pm
by Acki
Please show your code for loading the mesh...

Posted: Wed May 04, 2005 12:31 pm
by IllegalEnzyme

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh("my_mesh.3ds");
ISceneNode* node = smgr->addOctTreeSceneNode(mesh);
After that i put in a bit of collision detection but that shouldn't effect it.

PS i used an octtree cos its a big static room model that was rendering really slowly on my comp as a normal scene node.

i didn't load any textures as these are loaded from the 3ds file, they just aren't being rendered for some reason. :( :(

Posted: Thu May 05, 2005 1:31 pm
by IllegalEnzyme
yay... i fixed it, for anyone else who has the same problem make sure that each part of the model that has a different texture is a different group/object. :D :D :D :D me happy now! lol

Posted: Sun May 08, 2005 8:16 am
by nicesun
Hi,

I've got the same problem, but I didn't find the solution:

In the modeler, I've got three object cleary separated, but how do you texture them in irrlicht ?

My code :

scene::IAnimatedMesh* farmMesh = smgr->getMesh("../../media/farm.3ds");

scene::ISceneNode* node = 0;
node = smgr->addOctTreeSceneNode(farmMesh);

node->setMaterialTexture(0, driver->getTexture("../../media/grass.jpg"));
node->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg"));
node->setMaterialTexture(0, driver->getTexture("../../media/roof.jpg"));

but like you, only one texture covers the rest..

How did you do it ?

Posted: Sun May 08, 2005 8:26 am
by nicesun
OK,

I've just seen you don't have to use setMaterialTexture, it works now...

Posted: Tue May 10, 2005 10:53 am
by IllegalEnzyme
yeah, you texture the model in the modeller, when saved to 3ds format irrlicht will load the textures automatically.