🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

how to map diferent objects??

Started by
3 comments, last by Bruno 24 years ago
HI Lets say i have a texture with 64x64, and i want to map a quad, everything is ok., but if with the same texture i wan''t to map a very long rectangle, opengl strechs the texture so that the texture fits the rectangle, but doing this i lose the quality of the texture Is there a way around this? thanks Bruno
Advertisement
You can tile the texture multiple times across the face by using higher numbers for your texture coordinates. Rather than using 1.0f try using 2.0f or 3.0f etc etc, using 2.0 will tile the texture 2 times. By passing OpenGL a number greater than 1.0f you tell OpenGL to tile the texture, just make sure you have GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T set to GL_REPEAT.

Nate Miller
http://nate.scuzzy.net
Thanks a lot Nate
Yes, I''m a newbie. Could you please tell me how exactly to set GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T to GL_REPEAT?
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

Nate
http://nate.scuzzy.net

This topic is closed to new replies.

Advertisement