Hi all,
I want to make a walkthru in a complex scene.
My problem is, how can i find the z-coordinate for a given point (x,y) in the XY-Plane (e.g. for walking up stairs).


You could use feedback mode (never used), read from the depth buffer (don’t know how to) or remember where you’ve drawn which point. The first two possibilities won’t give you the result expected. From the z-buffer (depth buffer) you’ll get a value from 0 to 1. You must recalculate that value to a real z-value first (using the z-near and z-far parameters of glFrustum() or gluPerspective()).

For what do you need the z coordinate for a given point? When posting a problem, you should explain it exactly for others to help you. Maybe there’s a better solution for your problem.

[This message has been edited by mm_freak (edited 11-05-2002).]