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 2 of 2

Thread: zbuffer to range measure?

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    Hampton Roads, VA
    Posts
    1

    zbuffer to range measure?

    I know I've seen a formula for converting the values returned by reading the zbuffer with glReadPixels() into distance from eyepoint. But now that I need it, I can't find it. Can anyone point me in the right direction?

    Thanks

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: zbuffer to range measure?

    http://www.cs.unc.edu/~hoff/techrep/openglz.html

    Remember this will give you eyespace z not distance. You'll need to compensate for tan theta if sampling off center from the view vector. Range is only equal to z if eyepace x & y are zero.

Posting Permissions

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