arthas
03-18-2008, 01:44 AM
Hi, in texture mapping, I usually give texture coordinates between 0 and 1, I saw a lot of programs and examples and this rule is always used.. Is it possible to set different coordinates, i mean using world coordinates instead of texture coordinates? f.e.:
this is the correct way to do texture mapping
glBegin(GL_QUADS);
{
glTexCoord3f(0.0,0.0,0.5); glVertex3f(0.0,0.0,0.5);
glTexCoord3f(1.0,0.0,0.5); glVertex3f(1.0,0.0,0.5);
glTexCoord3f(1.0,1.0,0.5); glVertex3f(1.0,1.0,0.5);
glTexCoord3f(0.0,1.0,0.5); glVertex3f(0.0,1.0,0.5);
}
glEnd();
Is it possible to set something like this?:
glTexCoord3f(-1,0.0,0.5); glVertex3f(-1,0.0,0.5);
glTexCoord3f(2.0,0.0,0.5); glVertex3f(2.0,0.0,0.5);
glTexCoord3f(2.0,1.0,0.5); glVertex3f(2.0,1.0,0.5);
glTexCoord3f(-1,1.0,0.5); glVertex3f(-1,1.0,0.5);
maybe setting a color to use if my glTexCoord3f isn't from 0 to 1..
this is the correct way to do texture mapping
glBegin(GL_QUADS);
{
glTexCoord3f(0.0,0.0,0.5); glVertex3f(0.0,0.0,0.5);
glTexCoord3f(1.0,0.0,0.5); glVertex3f(1.0,0.0,0.5);
glTexCoord3f(1.0,1.0,0.5); glVertex3f(1.0,1.0,0.5);
glTexCoord3f(0.0,1.0,0.5); glVertex3f(0.0,1.0,0.5);
}
glEnd();
Is it possible to set something like this?:
glTexCoord3f(-1,0.0,0.5); glVertex3f(-1,0.0,0.5);
glTexCoord3f(2.0,0.0,0.5); glVertex3f(2.0,0.0,0.5);
glTexCoord3f(2.0,1.0,0.5); glVertex3f(2.0,1.0,0.5);
glTexCoord3f(-1,1.0,0.5); glVertex3f(-1,1.0,0.5);
maybe setting a color to use if my glTexCoord3f isn't from 0 to 1..