Texturing a .3DS Mesh for use as a level\map

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
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Texturing a .3DS Mesh for use as a level\map

Post by d3jake »

(So people know, I've read a few guides, and FAQs about posting here, so if I slip up, feel free to rattle my cage about it...)

Okay, I have started with the 01.HelloWorld example and I am trying to load a .3ds file. So far, I have a model of a Pyro-GX from Descent1\2 that had loaded correctly, and is displayed correctly. The reason why that one loads as far as I can tell is due to it having only one texture for the whole model which I used as a test when I first encountered this problem. And the code I used to load it was the example code to load the "sydney" model, with the filename changed to point to the ship's model. That also loaded the texture file correctly.
The trouble started when I was trying to load a Descent3 level that I converted to a .3ds with a tool I found on Planetdescent.com, which is a large repository of a ton of Descent-related files. I was able to correctly texture it when I brought it into 3ds Max, and exported it into a .3ds due to just plain saving it putting it into a .max file.
Here is a small picture of the level, that's now exactly how its supposed to look, but it gives you an idea.

I copied the lines that loaded the first .3ds model ( i had removed the:

Code: Select all

		node->setMD2Animation ( scene::EMAT_STAND );
Line due to me not working with a .md2 file. And changed the filename to the correct path, and the modelname of my model and compiled not everything went well. I saw this:
http://s10.photobucket.com/albums/a113/ ... escent.jpg
And the console said:
http://s10.photobucket.com/albums/a113/ ... escent.jpg

I did place the correct texture files in the same directory as the model, and at the end, you will see "Could not open file of texture: djctf_fixed.mat" That was because I was told by a friend who has some experiance with irrlicht that I had not given it a material file. This made sense to me because all of the textures used in the level's model were put into one Material that had 12 sub objects, or materials:
http://s10.photobucket.com/albums/a113/ ... ialSub.jpg

When I try to use a:

Code: Select all

        levelNode->setMaterialTexture( 0, driver->getTexture("facflor3.tga"));
It works, kinda... I get a lovley image of:[urlhttp://s10.photobucket.com/albums/a113/d3jake/technology/?action=view&current=materialSet.jpg[/url]

So, I'm not sure how to either pull that compound texture into seperate materials, or how to tell Irrlicht "Hey! I do know what I'm talking about, and the textures are right here, in the same dir that they've always been, where they're supposed to be. Or perhaps I've completely glazed over the correct fix...
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, mat files are not supported for 3ds, only .obj files have .mtl to store their material properties. 3ds does store them inside the file. So you have to tell your exporter to properly store the material settings into the 3ds file. This might require some additional changes inside 3dsmax, because some things are simply not supported by either the exporter or the loader, e.g. proper texture coords have to be defined for your mesh, no autoamtic texture projections.
But as it seems it's jsut a problem with texture file names that you encountered for all other files. So check that the names and paths are matching.
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

Yeah, That is nice to know. Conviently, for my project we're moving our models to .MD3, which should all work...
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

md3 is not yet fully supported in Irrlicht... The implementation currently suffers from some transformation problems, hence you cannot move the models.
Post Reply