i’m trying to figure out, how exactly opengl is doing its calculations, but i’m unable to get the same results on the paper as my computer does.
Could you tell me a document that exactly tells me, what operations openGL is doing when transformations from eye to monitor-coordinates are performed?
The vertex is multiplied with the ModelView and the Projection matrix, resulting in projection or clip coordinates. The vertex is then clipped and transformed into Normalized Device Coordinates by dividing x, y and z coodinates by the homogenous coordinate w. X and y now fall in the range (-1 … +1), where -1 is the left or bottom edge and +1 is the right or top edge of your viewport.
To get from NDC to screen coordinates you have to apply the following formula:
Where the (x_nd, y_nd) are the normalized device coordinates of the transformed vertex, (x_s, y_s) are the screen coordinates, (vp_x, vp_y) specifies the lower-left corner and (vp_width, vp_height) the size of the viewport.