Getting distances from the z buffer |
Author :
strider
Post Date :
2006-09-19 14:37
Posts :
1
|
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.
|
Author :
grant
Post Date :
2006-09-21 16:46
Posts :
117
|
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 |
All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005