Page 1 of 1
.obj mesh textures missing !!!!
Posted: Thu Apr 07, 2005 3:05 pm
by Athlon_Jedi
ok i am having a wierd problem, my mesh which is in .obj format LOSES its textures when it loads! leaving me a black mesh lol. how do i fix it?

ummm
Posted: Thu Apr 07, 2005 7:03 pm
by Anteater
I hate to be the bringer of bad news, but as far as I know .obj doesn't support textures at all. All it has is B/W.
Posted: Thu Apr 07, 2005 7:41 pm
by bitplane
just manually add the texture map
Code: Select all
yourobj->setMaterialTexture(0,driver->getTexture("texturemap.bmp"));
works a charm here apart from the edges look kinda rough. I'm guessing none of the info held in the .mtl file is loaded.
Posted: Thu Apr 07, 2005 9:33 pm
by Electron
.obj does suports materials (with textures) but they are not contained in the .obj file and must be in a separate .mtl file. Unfortunately Irrlicht does not load these
an issue for Niko ?
Posted: Fri Apr 08, 2005 2:32 pm
by Alex001
I had the same problem some days ago.
Cound not find a working solution for that problem.
Just to add
object->setMaterialTexture(0,driver->getTexture("texture.jpg"))
is only a workaround.
But I am afraid it's not a good solution because all the texture mapping will get lost.
My hope is, Niko will add a little more support to the wave format.
Then we could use "Art of Illusion", which supports wave output.

.obj textures
Posted: Thu Apr 14, 2005 11:12 am
by Klaus Niederkruger
A year ago I was playing with irrlicht and with an OBJ-model made with lightwave, and I had a similar problem. I remember that I fixed it, but it was more a hack, and thus I never send the fix to Niko.
Maybe some of you wants to write a patch??
As far as I remeber the OBJ-format worked like this:
you declare a list of vectors, texture coordinates, colors whatever, and you define triangles saying:
triangle should be composed by vertex 501,123,126, it should use color 127,456,343 at each vertex etc.
But OBJ also supports negative indeces for vertices etc. to count backward, i.e.
triangle -1,-2,-3
would be a triangle, which is composed of the last vertex defined, the one defined before, and the one defined before this other one... I don't know if it is clear, what I mean.
The problem with irrlicht is that it does not implement counting backwards.
If you try to correct this, good luck.
Klaus
nevermind
Posted: Thu Apr 14, 2005 2:46 pm
by Athlon_Jedi
thats ok im not a good enough coder for that lol, im just going to switch to .3ds format.