PDA

View Full Version : precise texturing



09-21-2003, 10:58 AM
hi

i have a texture binded and draw a plane:

glTexCoord2f(0.0, 0.0); glVertex3f(0.0, 0.0, 0.0);
glTexCoord2f(1.0, 0.0); glVertex3f(1.0, 0.0, 0.0);
glTexCoord2f(1.0,-1.0); glVertex3f(1.0,-1.0, 0.0);
glTexCoord2f(0.0,-1.0); glVertex3f(0.0,-1.0, 0.0);

but i would like to use pixel precise texture
mapping, as texture is not alaways same size,
these functions seem to work like by percent
of this dimension of texture,
how can i use precise texture mapping - that
coordinates stay on places even if i resize
the textures?

09-21-2003, 11:01 AM
before you maybe ask:

texture is binded with:
glBindTexture(GL_TEXTURE_2D, MapTex[0]);

and vertexes are using:
glBegin(GL_TRIANGLE_FAN);