glTexCoord2f();

Started by
3 comments, last by SmiLeY1k2k 22 years, 1 month ago
Where can i find alot more detailed information about glTexCoord2f, cause i don''t understand them because i can never get the image where i want it , its always flipped and disorted. Thanks
Advertisement
how about posting your code?
infos about how it works should be given in the nehe-tutorials more than enough.
before every glVertex call set the texcoord for the vertex you want to send to gl

we wanna play, not watch the pictures

If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

OpenGL programmer's guide

OpenGL reference manual

Microsoft MSDN




To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

[edited by - jenova on March 17, 2002 4:41:00 PM]
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
This is the code. This bitmap is 512 x 512!
Also which is the best open gl book to buy, for at least $40?

glBindTexture(GL_TEXTURE_2D, g_Texture[0]);
glBegin(GL_QUADS); // Draw A Quad

glTexCoord2f(1,0);
glVertex3f(-1.8f, 2.5f, 0.0f); // Top Left

glTexCoord2f(0,1);
glVertex3f( 4.8f, 2.5f, 0.0f); // Top Right

glTexCoord2f(1,0);
glVertex3f( 4.8f,-2.5f, 0.0f); // Bottom Right

glTexCoord2f(1,0);
glVertex3f(-1.8f,-2.5f, 0.0f); // Bottom Left

glEnd();
glTexCoord2f(1,0);
glVertex3f( 4.8f,-2.5f, 0.0f); // Bottom Right

glTexCoord2f(1,0);
glVertex3f(-1.8f,-2.5f, 0.0f); // Bottom Left

the last two vertices do have the same texcoords..
i guess one of those two should have glTexCoord2f(1,1)
try out

and, if the image is flipped, try to swap those coordinates..
for example swap all first coordinates of glTexCoord3f(a,b) //in this case: a, means 0 to 1, and 1 to 0

try the different ways till you find yours..
thats the way i learned it.. and .. not to feel good, but i think i know some stuff of gl now..

PerPixelLighting

at least the texcoords work in this demo


oh, i guess you could try the redbook, you can find it online, link is on nehe's page..
web has enough good info for you, you don't have to pay (except the connection-bills)

EDIT:i hate those different forum-standards.. no automatical link detection here..

[edited by - davepermen on March 17, 2002 5:02:57 PM]
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

This topic is closed to new replies.

Advertisement