PDA

View Full Version : view problem



jono_123
11-20-2002, 12:30 AM
hi
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).]

MickeyMouse
11-20-2002, 01:29 AM
Hi!
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

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

MickeyMouse
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/