Reversed textures

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Reversed textures

Post 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.
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: Reversed textures

Post 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
Bounty Scanner
Number 935
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Reversed textures

Post 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.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

sweet :-)
Just in time for my new creation, the Diamondback.

cheers.
Post Reply