PDA

View Full Version : Tile texture



Mishuk
01-11-2003, 10:09 AM
HI!
How can i make texture tile in a quad. Say i'm drawing a 50X50 qaud and now i want to make tile a 128x128 resolution texture on it. I have no idea how to do it.

Any help?

Thank you
Mishuk

padlamoij
01-12-2003, 07:59 PM
um i think i might know what you are asking. I think you are asking if you can tile a texure map on a quad. you need to setup two functions first.

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); //for the s direction
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); //for the t direction

then you set the 1.0's in your glTexCoord2f() to 2.0 or however many times you want them to tile. I don't know if this was what you were asking but i hope it helps. bye.

[This message has been edited by padlamoij (edited 01-12-2003).]

nexusone
01-13-2003, 08:16 AM
You have two diffrent type of objects a bitmap and a vector. When working with 3D object they are built around vector's, were as bitmaps are based on pixels.

The unit size of the quad does not make any diffrence execpt in the view setting and drawing of the world.

You can map a 128 x 128 texture to a 1 x 1 unit vector quad and get the same results as a if mapped to a 50 x 50 quad.

If you need to know how to load a texture, try this website nehe.gamedev.net



Originally posted by Mishuk:
HI!
How can i make texture tile in a quad. Say i'm drawing a 50X50 qaud and now i want to make tile a 128x128 resolution texture on it. I have no idea how to do it.

Any help?

Thank you
Mishuk



[This message has been edited by nexusone (edited 01-13-2003).]