Jump to content
  • Advertisement

Archived

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

LongJohn

multitple textures for big surfaces ?

This topic is 5648 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, is there any build-in otion to map a single texture multiple times automazicaly ? let´s say we are building a brick-wall,i have the texture,i have a big quad,the texture is in a way that it looks good if pasted multiple times.. do i really have to divide the wall ?

Share this post


Link to post
Share on other sites
Advertisement
If your the brick wall takes up the whole width of the texture, you can tile it horizontally (without it turning out odd). Likewise, if it takes up the whole height, you can tile it vertically (without it turning out odd). If it takes up the whole texture, you can tile it however you want .

I think textures are created with repeating turned on by default, so just use texture coordinates greater than 1.0 (or less than 0.0) to repeat the texture.

Share this post


Link to post
Share on other sites
by using texcoordinates. if texture repeats twice in both directions then
texcoord2f(2.0,2.0);

Bobby

Share this post


Link to post
Share on other sites
Just in order to clarify BGCJR''s post :

If you want to stretch your texture all over a quad :

  
glBegin();
glTexCoord2f(0, 0); glVertex3fv(lower_left_corner);
glTexCoord2f(1, 0); glVertex3fv(lower_right_corner);
glTexCoord2f(1, 1); glVertex3fv(upper_right_corner);
glTexCoord2f(0, 1); glVertex3fv(upper_left_corner);
glEnd();


Now if you want to repeat your texture 5 times over a quad :

  
glBegin();
glTexCoord2f(0, 0); glVertex3fv(lower_left_corner);
glTexCoord2f(5, 0); glVertex3fv(lower_right_corner);
glTexCoord2f(5, 5); glVertex3fv(upper_right_corner);
glTexCoord2f(0, 5); glVertex3fv(upper_left_corner);
glEnd();

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!