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 ).
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
3ds and textures
-
- Posts: 31
- Joined: Mon Dec 15, 2003 5:49 pm
- Location: Ireland
- Contact:
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?
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
Join the gameplayzone forums today!
http://www.gameplayzone.com
All the latest gaming news and advancements
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*
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
Are you sure your cube has UV coordinates ?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)
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);
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