Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Sub-Texture coordinates

  1. #1
    Guest

    Sub-Texture coordinates

    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

  2. #2

    Re: Sub-Texture coordinates

    why don't u simply try (0,0) and (255,255)?

    Doesn't it work?


    Toni
    Virtual Reality: Insideo

  3. #3
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,119

    Re: Sub-Texture coordinates

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •