PDA

View Full Version : drawing texute multilple times



Anish
08-05-2005, 08:31 PM
Hai,

I want to draw a Wall and fill one side bith Brick textures.

I loaded and drew the texture correctly.

But my problems is according to the wall size i want to repeat the texture, not resize.

this way i loaded the texture
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);

Anyone have any idea?? :(

Thanks in advance :)

jide
08-06-2005, 03:20 AM
You can use texture coordinates to do that. Generally, you use values between 0 and 1. Now you can use values ranged from 0 up to the value you want.


glTexCoord2f (0,0);
glTexCoord2f (2,0);
glTexCoord2f (2,2);
glTexCoord2f (0,2);will repeat the texture twice in both directions. Just make some tests changing the values to see what happen :)

Dj3hut1
08-06-2005, 11:54 PM
Hello,

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_REPEAT);? http://amor.cms.hu-berlin.de/~welsands/chat_old/114.gif

I think you mean :
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

Dj3hut1