Menu
Forums
Login | Register

Home > Forums > OpenGL > Getting distances from the z buffer Page :  1 
Getting distances from the z buffer
Hi. I have a simple program that loads a triangular mesh object and views it from a perspective projection.

For each screen (x,y) coordinate I'd like to be able to get the distance to the pixel under it.

I don't know if I'm explaining myself well being new to opengl. If anyone has any ideas I'd appreciate any suggestions you might have.

Hi,

You can use glCopyPixels with the GL_DEPTH parameter to get all depth values in the depth buffer.

These values are however between 0.0 and 1.0, which therefore requires you to convert back to your own world values.

Regards,
Grant

Home > Forums > OpenGL > Getting distances from the z buffer Page :  1 

You need to be logged in to reply to this topic.


All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005

Read the Disclaimer

Links