• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# using pixels instead of floats for OGL

## Recommended Posts

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.


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();

yes, me = noob thanks for all the people with the patience ot help

##### Share on other sites
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

##### Share on other sites
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]

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627677
• Total Posts
2978589

• 11
• 12
• 10
• 12
• 22