Archived

This topic is now archived and is closed to further replies.

Texture UVs

This topic is 5316 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I''m trying to play with UV''s. From what I understood the U was the x of the picture and the V was the y. So, what I''m trying to do for now is display the upper left corner of the picture on a Quad. I''m using the following code, but it''s not giving the desired effect.


glTexCoord2f(0,0);
glVertex3f(0,0,-10);

glTexCoord2f(.5f,0);
glVertex3f(3,0,-10);

glTexCoord2f(.5f,.5f);
glVertex3f(3,3,-10);

glTexCoord2f(0,.5f);
glVertex3f(0,3,-10);

glEnd();


A CRPG in development... Need help? Well, go FAQ yourself. "Just don''t look at the hole." -- Unspoken_Magi

Share on other sites
It looks like you''re using coordinate of the lower left corner of the texture

Share on other sites
Well, specify what effect you get, and what effect you would liek to get.

Height Map Editor | Eternal Lands | Fast User Directory

Share on other sites
In an image editor (0,0) is the top-left corner of your image. In OpenGL (0,0) is the bottom-left corner. so u=x and v=1-y

Sander Maréchal

Share on other sites
Okay. Thanks that helps a lot. I didn''t realize that.

• Forum Statistics

• Total Topics
628750
• Total Posts
2984497

• 12
• 25
• 12
• 10
• 17