glBegin(GL_QUADS);
glTexCoord2i(tilesize*tileX-tilesize,tilesize*tileY-tilesize);
glVertex2f(0,0);
glTexCoord2i(tilesize*tileX,tilesize*tileY-tilesize);
glVertex2f(1,0);
glTexCoord2i(tilesize*tileX,tilesize*tileY);
glVertex2f(1,1);
glTexCoord2i(tilesize*tileX-tilesize,tilesize*tileY);
glVertex2f(0,1);
glEnd();
using pixels instead of floats for OGL
to use the msrment in pixels instead of a float I use i instead of f, right?, so this should work, but it doesn''t:
NOTE: tileX = 1, tileY = 1, tilesize = 32.
I am trying to get hte bottom left tile, instead i get the whole image looped.
yes, me = noob
thanks for all the people with the patience ot help
You really don''t want to specify the texture coordinates as integers.
The texture coordinates are in the range 0-1, everything over means the texture is tiled.
Height Map Editor | Eternal Lands | Fast User Directory
The texture coordinates are in the range 0-1, everything over means the texture is tiled.
Height Map Editor | Eternal Lands | Fast User Directory
oh so that isn't how to speify it as pixels, how can I though, not too comfortable with 0-1 type stuff
EDIT:: nm i was tryinjg to do this to get around a problem but i figured it out. i couldve defined a pixel as 1/512 though and used float (the big pic is 512px)
[edited by - PlagueViper on May 28, 2003 7:10:37 PM]
EDIT:: nm i was tryinjg to do this to get around a problem but i figured it out. i couldve defined a pixel as 1/512 though and used float (the big pic is 512px)
[edited by - PlagueViper on May 28, 2003 7:10:37 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement