I have an existing class which transforms 3D vectors and projects them on a 2D plane (Camera). The code is all written in C without help from an external library.
To project a single vector (X,Y,Z) on the screen, the code first applies the View matrix of the camera and then for the actual projection does the following:
ScreenX and ScreenY are then used as the screen coordinates (after additional scaling and translation).
What kind of projection is this?
Since it uses the Z coordinate to adjust the X and Y coordinates, I would think it is a perspective projection, but I'm not sure. If it's indeed a perspectice projection, then what would be the FOV for this?
I'm just trying to understand how the existing code works so that I can rebuild it using standard libraries and using a standard projection matrix if possible.
Edit - Some more information:
After this division, the coordinates are multiplied (scaled) by the "lens resolution" (pixels per unit) and translated by the lens center (X,Y coordinates in pixels):
ScreenX = ScreenX * Res + CenterX; ScreenY = ScreenY * Res + CenterY;
Res is a large number and I'm guessing it defines the projection plane, letting the coordinates scale from 0 to the size of the actual image in pixels.