PDA

View Full Version : How to render depth image for a 3D model ?



kingding
02-02-2013, 05:16 PM
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.

tonyo_au
02-02-2013, 06:29 PM
Explain "failed" - did it error or was the data all zeros?

kingding
02-02-2013, 09:18 PM
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.