*SOLVED* 3ds texture problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
IllegalEnzyme
Posts: 23
Joined: Wed Jun 09, 2004 8:51 am
Location: i'm lost, help me!

*SOLVED* 3ds texture problem

Post 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
Last edited by IllegalEnzyme on Thu May 05, 2005 1:32 pm, edited 1 time in total.
Signatures suck cos i can never think wot to write!
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Please show your code for loading the mesh...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IllegalEnzyme
Posts: 23
Joined: Wed Jun 09, 2004 8:51 am
Location: i'm lost, help me!

Post 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. :( :(
Signatures suck cos i can never think wot to write!
IllegalEnzyme
Posts: 23
Joined: Wed Jun 09, 2004 8:51 am
Location: i'm lost, help me!

Post 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
Signatures suck cos i can never think wot to write!
nicesun
Posts: 9
Joined: Mon Dec 27, 2004 1:32 pm

Post 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 ?
nicesun
Posts: 9
Joined: Mon Dec 27, 2004 1:32 pm

Post by nicesun »

OK,

I've just seen you don't have to use setMaterialTexture, it works now...
IllegalEnzyme
Posts: 23
Joined: Wed Jun 09, 2004 8:51 am
Location: i'm lost, help me!

Post by IllegalEnzyme »

yeah, you texture the model in the modeller, when saved to 3ds format irrlicht will load the textures automatically.
Signatures suck cos i can never think wot to write!
Post Reply