Archived

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

LongJohn

multitple textures for big surfaces ?

Recommended Posts

LongJohn    122
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
Null and Void    1088
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
vincoof    514
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