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: How to render depth image for a 3D model ?

  1. #1
    Newbie Newbie
    Join Date
    Feb 2013
    Posts
    2

    How to render depth image for a 3D model ?

    hi~

    I used glReadPixels(0, 0, winw, winh, GL_DEPTH_COMPONENT, GL_FLOAT, zData);

    but failed.

    Does anyone can provide source code for this function?

    thanks so much.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,109
    Explain "failed" - did it error or was the data all zeros?

  3. #3
    Newbie Newbie
    Join Date
    Feb 2013
    Posts
    2
    Quote Originally Posted by tonyo_au View Post
    Explain "failed" - did it error or was the data all zeros?


    thanks for your reply. This is the output image: www.ihncs.com/thread-2733-1-1.html


    It seems the output image is not the depth image. The correct image should be a depth image of plane in the middle of the image.

Posting Permissions

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