From Eyecoordinates to Monitorcoords

Hello,

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?

ex: I got a point
(1,0,0)
ModelviewMatrix
/1 0 0 0
|0 1 0 0 |
|0 0 1 -150 |
\0 0 0 1 /
and ProjectionMatrix
/0.5 0 0 0
|0 0.5 0 0 |
|0 0 -1.22222 -111.111 |
\0 0 -1 0 /
vieport: 0,0,300,300

at which point of my window will my point appear?
I appreciate your help!

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:

  x_s = (x_nd + 1) * (vp_width  / 2) + vp_x
  y_s = (y_nd + 1) * (vp_height / 2) + vp_y

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.

Thanks! That helped a lot!