Creating OpenGL's perspective projection matrix from calibrated parameters
Hi everyone,
I have calibrated intrinsic parameters, i.e. fx, fy, cx, cy. And I wanted to create perspective projection matrix for OpenGL. Normally in OpenGL you would either call glFrustum which follows the similar matrix below, or glm::perspective function if you're using GLM.
However, when I look into how perspective projection matrix on OpenGL are created, it doesn't factor in focal points and camera's principal points. How should I modify the matrix in order to consider those intrinsic parameters?
In the end I'd like to create a MVP (model view projection) matrix by doing MVP = projection * view * model. With model's translation and rotation matrix obtained from solvePnP, thus. model = inverse( translation * rotation ) ,
Any idea on how should I create the perspective projection matrix?