Convert the given 3D point to 2D (project it onto the viewing plane, (sx, sy, 0) - (sx + w, sy + h, 0).
The input is assumed to be in the unit square (0, 0, z) - (1, 1, z). The viewpoint of the observer is passed in vp.
This is basically the opposite of vector_2d_to_3d.
| sx |
the abscissa of the upper-left screen rectangle. |
| sy |
the ordinate of the upper-left screen rectangle. |
| w |
the width of the screen rectangle. |
| h |
the height of the screen rectangle. |
| x |
the abscissa of the point in the screen rectangle to map. |
| y |
the ordinate of the point in the screen rectangle to map. |
| vp |
position of the observer. |
| p |
the 3D point to project to the plane. |