Question

After a 3d point has been transformed by a perspective projection matrix, what do the Z coordinate stand for? Distance from the 'eye'? Distance from the near clip plane? None of this?

Edit

I've set up a matrix using the glFustrum definition found here.

Then, I transform a 3D point with that matrix.

I'm left with a 3D point where X and Y are the coordinates of the point on the near frustum face, and Z, supposedly a depth information that I have a hard time exploiting.

Thanks!

Was it helpful?

Solution

The transformed z (that you use as denominator for dividing x and y) is the distance from the eye in the perpendicular direction to the projection plane, scaled so that the projection plane is at distance 1.

OTHER TIPS

It's been a while for me, but if you have the X and Y coordinates on the frustrum, does not the Z control the layer order?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top