PDA

View Full Version : Sub-Texture coordinates



03-20-2006, 04:23 PM
Hi,

I have a texture with the size 1024x1024. I'm trying to get a part of it on the screen with the exact size.

The part has the coordiantes (0,0)x(256,256).


So the texture coordinates are supossed to be:
(0.5/1024,0.5/1024)x(255.5/1024,255.5/1024)

The screen coordinates are:
(0.5,0.5)x(255.5,255.5)

The problem is that the last vertical and horizontal line of the texture is missing on the screen.


I tried it all day long and I'm really stuck...


Thanks,
Thomas

Toni
03-20-2006, 04:51 PM
why don't u simply try (0,0) and (255,255)?

Doesn't it work?


Toni

k_szczech
03-20-2006, 08:48 PM
Note that 255.5 - 0.5 = 255.0, and you need 256 pixels to be visible. You simply have your quad too small by one pixel.