PDA

View Full Version : How to draw one texture fewtimes on one shape, in stead of make it larger



jirkamelich
12-07-2002, 08:45 AM
How to draw one texture fewtimes on one shape, in stead of make it larger.

KenR7A
12-07-2002, 09:13 AM
I think all you have to do is specify coordinates bigger than one...like this maybe on a quad?

glTexCoord2f(2,2);
glTexCoord2f(0,2);
glTexCoord2f(0,0);
glTexCoord2f(0,2);

would draw it 4 times if im correct.

yakuza
12-07-2002, 10:24 AM
Also, make sure you set the texture wrapping mode to GL_REPEAT.

jirkamelich
12-07-2002, 10:56 AM
how could i set the wrapping model to GL_REPEAT

yakuza
12-07-2002, 11:16 AM
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

Page 410 of the Redbook.

jirkamelich
12-07-2002, 11:32 AM
what different does it make, it works without it also

chowe6685
12-07-2002, 11:41 AM
If it does't matter it's because the default behavior is GL_REPEAT, however, it's probably good to get in the habit of setting such things because there may come a time when the default behavior is not what you want.

jirkamelich
12-07-2002, 11:59 AM
can you please tell me, what could be other setting of wrapping ?

Bob
12-07-2002, 01:51 PM
Why not look in some documentations? There are lots of them on the net, and it isn't that hard to find them. Anyways, the other wrapping modes are GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER and GL_MIRRORED_REPEAT.