Page 1 of 1

Reversed textures

Posted: Sun Jan 24, 2010 12:00 pm
by Killer Wolf
Is there any hope of getting Oolite to show a texture as-is? it's annoying having to do everything in reverse.

Re: Reversed textures

Posted: Sun Jan 24, 2010 12:08 pm
by Frame
Killer Wolf wrote:
Is there any hope of getting Oolite to show a texture as-is? it's annoying having to do everything in reverse.
you should be able to show a texture "as is".., it is more than likely your model file exporter is not negating the vertex data correct...

meaning in my python script, it sets X coordinate to be negative meaning it mirrors the texture..

Reverse textures is a "feature" of OpenGL texture-ring, since it reads the texture from bottom left, instead of top right as you are used to in a paint program.

Anyway, your model exporter tool should negate the values to allow for correct texturing..

the specific entry in the python script that I use looks like this...

Code: Select all

# negate x value for vertex to allow correct texturing...
				x = -float(tokens[1])
				y = float(tokens[2])
				z = float(tokens[3])
cheers Frame

Re: Reversed textures

Posted: Sun Jan 24, 2010 2:38 pm
by JensAyton
Frame wrote:
Reverse textures is a "feature" of OpenGL texture-ring, since it reads the texture from bottom left, instead of top right as you are used to in a paint program.
Er, no. Actually it’s a result of Oolite’s coordinate system not matching that of OBJ files (or most other 3D file formats). Without proper correction, the entire model is mirrored, not the textures as such.

In any case, the current versions of Obj2DatTex.py (and now, Obj2DatTexNorm.py) handle this for you.

Posted: Sun Jan 24, 2010 3:37 pm
by Killer Wolf
sweet :-)
Just in time for my new creation, the Diamondback.

cheers.