Advertisement

multitple textures for big surfaces ?

Started by January 29, 2003 03:48 PM
3 comments, last by LongJohn 22 years, 1 month ago
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 ?
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.

Advertisement
by using texcoordinates. if texture repeats twice in both directions then
texcoord2f(2.0,2.0);

Bobby
Game Core
Note: Textures will normally tile on their own in OpenGl unless you stop it.
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();  

This topic is closed to new replies.

Advertisement