Sign in to follow this  

Texture problem in opengl

This topic is 3864 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

Hi!:) When I apply texture on my object, the textures appear either stretched or just does not fit the primitives at all. I have built a more complicated object out of only quads, but on some of the quads the texture fits nicely, but some just does`not seem right at all. On one of the longer quads the texture seem literally stretched, and on the smaller ones the texture seem "compressed".(i.e the details in the texture are just too close together) The texture I am using have the following dimensions: 512*512. The texture enviroment is set to: glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); The texture parameter is set to the following: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); Does anyone have any idea what I can do to make the textures look better on my objects? Or: How do I tweak the placement of the texture on my object, to make it more good-looking?

Share this post


Link to post
Share on other sites
Make your model have quads which are roughly the same size. If a quad is too big for a tecture then OpenGL will streth the texture for it to fit in the quad, and vice versa.
I think you should model your work on a 3D modelleing software and apply the texture to see the result before exporting it to your game. Try blender, i hear it's free.

Share this post


Link to post
Share on other sites
You also adjust the texture coordinates of the vertices that make up the quad to adjust how the texture looks.

Before continuing I suggest that you look at some tuturials on texturing; google can provide you with many.

Share this post


Link to post
Share on other sites

This topic is 3864 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this