Archived

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

Image without streching

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

First of all hello ! Well. I am loading images to make my floor. The problem is: I want to repeat the image many times until the floor finishes. But the imaging is getting streched. glBindTexture(GL_TEXTURE_2D, texChao); glBegin(gl_quads); glNormal3f( 0.0, 1.0, 0.0); glTexCoord2f(0.0, 1.0); glVertex3D((iWidth div 2) * -1, chao_EixoY, 2); glTexCoord2f(0.0, 0.0); glVertex3D((iWidth div 2) * -1, chao_EixoY, iHeight * -1); glTexCoord2f(1.0, 0.0); glVertex3D((iWidth div 2), chao_EixoY, iHeight * -1); glTexCoord2f(1.0, 1.0); glVertex3D((iWidth div 2), chao_EixoY, 2); glEnd; How to do ?

Share this post


Link to post
Share on other sites
also make sure to that this is the code in your texture object setup (as opposied to specifing gl_CLAMP_TO_EDGE or GL_CLAMP) . If not specified GL_REPEAT is the default.

glBindTexture(GL_TEXTURE_2D, texChao);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);






[edited by - _walrus on June 3, 2003 9:25:44 AM]

Share this post


Link to post
Share on other sites
Can you indicate on which axis the textures are being stretched, as that might help.

A couple of questions...

Are your quads intented to be squares, if so, is it worth displaying the tiles without the textures - to check whether it is the texture or the quad that is being stretched?

is your original image for the texture a square to begin with?

Share this post


Link to post
Share on other sites