Results 1 to 2 of 2

Thread: the winZ value of gluProject()

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2001
    Posts
    25

    the winZ value of gluProject()

    when I use gluProject() to get the windows pixel coordinates, the winZ value which stands for depth is always close to 1.0 eventhough the 3D point is far from the zfar plane.

    Does anybody know why? the program works fine with depth-test.

    J.H.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: the winZ value of gluProject()

    The winZ coordinate is not linearly distributed between the near and far clip planes. That means that winZ = 0.5 does not mean halfway between the near and far clip plane. The precision is closer to the near plane, which mean 0.5 is closer to the near plane than to the far plane. The amount of distribution closer to the near plane is directly linked to the position of the near and far clip planes. The greater the ratio far/near (divide the distance to the far clip plane by the distance to the near clip plane), the more distribution close to the near clip plane. If you always get numbers close to 1.0, it means you have a too large ratio. You should always push the near clip plane as far out as you can possibly accept.

Similar Threads

  1. glReadPixels depth vs gluProject winz
    By remdul in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 10-26-2005, 12:34 AM
  2. winz depth buffer relation
    By santhosh2708 in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 02-21-2003, 08:07 PM
  3. GluProject
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-04-2002, 08:53 PM
  4. gluProject()
    By schailan in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 09-09-2002, 05:41 AM
  5. WinZ???
    By CyBBe in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-15-2000, 05:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean