Skip to main content
gamedev.net
🔒 Locked

Problem: Inverted texcoords

Started by Max_Payne Aug 2, 2002 at 9:29 PM 2 replies 300+ views
Original Post
Max_Payne
Max_Payne
All tutorials i have found represent the texcoords like this: (0,1)---(1,1) | | | (0,0)---(1,0) But when i set the texcoords like that, the Y becomes inverted...., it doesnt make any sense, i tried drawing polygons counter clockwise instead of clockwise but it doesnt change anything...... My textures appear upside down when i specify the texcoords that way, unless i invert the Y axis (all 1 becomes 0, all 0 become 1). I would really like to fix this. does anyone know potential reasons for this bug?

Looking for a serious game project?
www.xgameproject.com
lp23
lp23
Check how you coordinate the texture to the vertex points -

glTexCoord2f(bottom_left_percent_x, bottom_left_percent_y);
glVertex3f(bottom_left_x, bottom_left_y, bottom_left_z);
glTexCoord2f(bottom_right_percent_x, bottom_right_percent_y);
glVertex3f(bottom_right_x, bottom_right_y, bottom_right_z);
glTexCoord2f(top_right_percent_x, top_right_percent_y);
glVertex3f(top_right_x, top_right_y, top_right_z);
glTexCoord2f(top_left_percent_x, top_left_percent_y);
glVertex3f(top_left_x, top_left_y, top_left_z);

Your y glVertex points should probably be reversed in your code. Hope this helps...

Luigi Pino
The 23rd Dimension
ZitherMan
ZitherMan
I belive textures are often drawn upside down? At least the texture i use for my MD2 file is...
----------------------------
When hell freez
Max_Payne
Max_Payne
Nevermind, i found the problem...... my targa textures are loaded properly, but my bitmap ones are loaded upside down, ill have to get that fixed

Looking for a serious game project?
www.xgameproject.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.