Question

I use the gluPerspective and glLookAt to set my projection matrix and view matrix. If I want to get the coordinate of the eye, it's the first three arguments in the gluLookAt, right?

However, now I need to get the projection plane, that is, the position of the screen in the world coordinate system. You know, if I can calculate the left-bottom corner point and the right-top corner point, the plane is right there!

Could anyone give me a hint about how to do this calculation?

Was it helpful?

Solution

You could use gluUnProject with screen space coordinates (mapping viewport width and height to 0…1) A=(0,0,0), B=(1,0,0) and C=(1,0,0) giving the coplanar points of the projection plane. Adding a fourth point (1,1,0) you get the rectangular limits.

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