View Full Version : view problem

11-20-2002, 12:30 AM
if have a point say at (0,0,0) that is in view but say there is a wall in front of it and i can not see this point on the screen how do i test for this??

[This message has been edited by jono_123 (edited 11-23-2002).]

11-20-2002, 01:29 AM
If you want to test whether your point is visible straight from your point of view just test value in depth buffer at projected XY coordinates of that point...
Use gluProject(..) for that.
Value in depth buffer equal to projected z-value from gluProject(..) means your point is visible. otherwise - not.

Hope it helps

11-21-2002, 12:29 PM
how do ya get the depth value from the depth buffer?

11-21-2002, 10:49 PM
Use glReadPixels(...) with GL_DEPTH_COMPONENT

Anyway why not to take a look at OpenGL manuals? They're very useful for beginners.

The redbook: http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/