Hi,
I am experiencing OpenGL.
But I am stuck, I wonder if you guys could give me a hand.
I have an image of 700x512 size and I scaled it down to 512x512 using gluScaleImage.
And would like to map to a rectangle(square) with no streching at all.
I have the following code segment. But it streches
Any help is appreciated.
Regards
TM
Code segment
…
…
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, 512, 512, GL_RGB, GL_UNSIGNED_BYTE, imageBuffer);
…
…
glBindTexture(GL_TEXTURE_2D, texture_id); //Texture for the frame
glBegin(GL_QUADS);
glTexCoord2f(1, 0); glVertex3f( 4,-1,-12);
glTexCoord2f(1, 1); glVertex3f( 4, 1,-12);
glTexCoord2f(0, 1); glVertex3f(-4, 1,-12);
glTexCoord2f(0, 0); glVertex3f(-4,-1,-12);
glEnd();