PDA

View Full Version : Tiled Textures



06-04-2001, 08:25 AM
Hello,

when I'm scaling a Block or something that is Texturemapped, OpenGL stretch the Picture. Is there a way to tile it?

Sorry for my bad english, I hope you could understand my problem. http://www.opengl.org/discussion_boards/ubb/smile.gif

06-04-2001, 02:39 PM
You have to change the texture coordinates.

Bob
06-05-2001, 12:13 AM
You can scale the texture matrix the same way you scale the object.



glMatrixMode(GL_MODELVIEW);
glScale(S, S, S);
glMatrixMode(GL_TEXTURE);
glScale(S, S, S);


[This message has been edited by Bob (edited 06-05-2001).]

DaViper
06-05-2001, 04:16 AM
glTexParamteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_ REPEAT)
glTexParamteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_t,GL_ REPEAT)
that should tile your texture instead of stretching it. you have to set your texture coordinates larger than 1.0 e.g. if you set them 0.0-5.0 the texture will be repated 5 times

Chris