Jump to content
  • Advertisement

Archived

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

Wickeeed

AboUt Offset && Tiling

This topic is 5449 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, my question[2]: question.1 = How to set Tiling ?? question.2 = how i can get tiling coords from a *.3ds ? ps i only cnow how to set Offset (glTexCoord2f(0.0f, 1.0f)

Share this post


Link to post
Share on other sites
Advertisement
Tiling is a combination of having an clampmode of GL_REPEAT, and having texture coords above the span of 0 to 1 ( if you have a wuad with texture cords from 0 to 2 you end up with 4 copies of the texture on it)

offsetting texturecoords is made by the texture matrix, help on glMatrixMode should give more information.

Share this post


Link to post
Share on other sites
glTexCoord2f(0.0f, 2.0f)



Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)
Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

Share this post


Link to post
Share on other sites
If you want to enable tiling with a certain texture, then add these lines when creating your texture:

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

Then whenever you supply texture coordinates over 1.0 for that texture, the texture will be tiled.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!