.obj mesh textures missing !!!!

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
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

.obj mesh textures missing !!!!

Post 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? :?
Anteater

ummm

Post 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.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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.
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post 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
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Alex001
Posts: 25
Joined: Tue Dec 02, 2003 8:20 pm
Location: Germany, Munich

an issue for Niko ?

Post 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.


:?:
Klaus Niederkruger

.obj textures

Post 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
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

nevermind

Post by Athlon_Jedi »

thats ok im not a good enough coder for that lol, im just going to switch to .3ds format.
Post Reply