3ds and textures

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
Alex001
Posts: 25
Joined: Tue Dec 02, 2003 8:20 pm
Location: Germany, Munich

3ds and textures

Post by Alex001 »

Hello,

does anybody know, why Irrlicht does not - or not always - use the textures of a d3s-file :?:
I tried to get an animated mesh into Irrlicht. The mesh has 2 materials and one texture (for diffuse). I made the file with Anim8or (very good by the way :lol: ).
Then I run Irrlicht in Debug mode. It loads the textures. So far, so good, but the texture is not used. I do not know why.
Does anybody know the reason for :?:

Thanks,
Alex001
unrealfragmaster
Posts: 31
Joined: Mon Dec 15, 2003 5:49 pm
Location: Ireland
Contact:

Post by unrealfragmaster »

I have a problem like that too. Sometimes the textures load in when I have Lighting set to FALSE. Make sure you haev that done too (see tutorial 1). It only works if you are currently seeing black textures.

However, I have tried to load a 3DS sphere which has an Earth texture. Lighting is off, but the sphere displays white. Anyone know why?
http://www.gameplayzone.com/forum
Join the gameplayzone forums today!
http://www.gameplayzone.com
All the latest gaming news and advancements
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

i don't believe materials are supported yet
SSmutny

Post by SSmutny »

It works for me! Just save your objects in 3ds as meshes and load them into irrlicht. The only thing you have to do to see the Textures is to make light in your scene.

driver->setAmbientLight(video::SColor(0,100,100,100));

Try this one aftler loading the mesh.

Hope it works!

mfg Sascha
akshoslaa
Posts: 1
Joined: Tue Dec 30, 2003 3:09 pm
Location: Perth, Western Australia

Post by akshoslaa »

I think I'm having the same problem...
I'm still new to 3D Modelling, so I assume it's something I've overlooked.

Using the helloworld example, I replaced sydney.md2 with a 3ds model exported from 3dsmax5, (a basic cube), just to see how it went. First up it didn't display the model at all... So I tried replacing it with the minotour model from neverwinter nights (the model is available as a 3ds from their website)
That displayed, (a couple of warnings about missing textures, (same ones I get when opning the file in 3dsmax) but the main texture was there, (as a tga file))
So I went back to my cube and tried again. This time I added a material to it before exporting (wall.jpg from the media directory) and this time the model loaded, but with no texture. If I load the texture the cube is simply coloured an 'average' color for the texture file (a yellowish brown). I can substitute it for different texture files which all provide different average colours... If I ommit the loading of the texture file, the model is textured with the "average colour" of it's original material from 3dsmax, (wall.jpg)
If I tell it to load a texture file that doesn't exist, the cube is them displayed in white (like if you ommit the texture for sydney.md2)

I've messed around with the lighting like was suggested, but that just gave me darker "averages".

I just had a thought that maybe the texture is 'zoomed out' or something like that. 3ds model appear overly large when they are displayed. (a 20*20*20 cube is about 150% the height of sydney)

*ponders*
O)-c
SuryIIID
Posts: 14
Joined: Mon Dec 29, 2003 8:54 pm
Location: Bulgaria..?

Post by SuryIIID »

I just had a thought that maybe the texture is 'zoomed out' or something like that. 3ds model appear overly large when they are displayed. (a 20*20*20 cube is about 150% the height of sydney)
Are you sure your cube has UV coordinates ?

if it's not just try this :

Code: Select all

scene::IAnimatedMesh* mesh = smgr->getMesh(
		"../../media/cube.3ds");
	    
	smgr->getMeshManipulator()->makePlanarTextureMapping(
	mesh->getMesh(0), 0.008f);
Alex001
Posts: 25
Joined: Tue Dec 02, 2003 8:20 pm
Location: Germany, Munich

Post by Alex001 »

:wink:
thank you all for your ideas. I try them today and will post my results too.
Guest

Post by Guest »

a-ha... that got it working.... thanks
Now I just need to figure out why... *reads
Alex001
Posts: 25
Joined: Tue Dec 02, 2003 8:20 pm
Location: Germany, Munich

Post by Alex001 »

:idea:

Thank you to everybody, who set me on the right way.
This are my results:
there must either be a light in the scene (driver->setAmbientLight() )
or the object which should be visible must be lighted by itself (sceneNode->setMaterialFlag(EMF_LIGHTING, false) ).
The texture must (!) be placed in the same directory with the mesh file to be found.

Alex
:wink:
Post Reply