Can I reverse the GL texture coordinate system?

Member
Posts: 110
Joined: 2002.04
Post: #1
Can I reverse the GL texture coordinate system?

Basically the textures 0,0 seems to be different from that of RAVE...
So... every texture is upside down :-)

Is there an easy way to reverse this like it was to set the left hand coordinate system
for the view/projection matrix?

Maybe do somthing to the texturematrix(?) I think there is one?

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Jeff Binder
Unregistered
 
Post: #2
You could use the texture matrix, which works just like the others (set the matrix to GL_TEXTURE). Ylthough you'll have a performance penalty if this matrix is not set to identity, so that's not an optimal solution. You can also flip all all of your 't' texture coordinates. Finally, you could just flip the images as you load them, which shouldn't be too difficult, depending on how you load them.
Quote this message in a reply
henryj
Unregistered
 
Post: #3
Remember that everything in opengl has the origin bottom left. So if your using quicktime or similar to load your textures you need to do a flip. It's best to do this at load time, then you don't have to worry about it. If you need to know how to do this post another message.
Quote this message in a reply
Member
Posts: 110
Joined: 2002.04
Post: #4
Quote:Originally posted by henryj
Remember that everything in opengl has the origin bottom left. So if your using quicktime or similar to load your textures you need to do a flip. It's best to do this at load time, then you don't have to worry about it. If you need to know how to do this post another message.

Im useing glpng.c open source code for loading PNGs into GL textures.

Now I could modify that to do the flip for me...
Which will probably be a pain.

Or do you have better solution?
can you get GL to flip the texture for you after you load it from the file?

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Member
Posts: 145
Joined: 2002.06
Post: #5
how hard would it be to just do 1-coord.y whever you use the y-coord? If your rendering code is written right, that should only be a couple places.

"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat

Bring Alistair Cooke's America to DVD!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL global and local coordinate problem. mikey 4 4,145 May 26, 2009 08:48 AM
Last Post: mikey
  Texture coordinate problem Oddity007 0 2,099 Jan 21, 2009 06:20 PM
Last Post: Oddity007
  terrain texture coordinate calculation akb825 12 8,705 Feb 27, 2007 04:56 PM
Last Post: akb825
  Reverse Engineering 3d File Format nabobnick 1 3,021 Aug 13, 2004 12:11 PM
Last Post: nabobnick