PsychCamIntrinsicsToGLProjectionMatrix

>Psychtoolbox>PsychOpenGL

M = PsychCamIntrinsicsToGLProjectionMatrix(cx, cy, fx, fy, zNear, zFar)

Given camera intrinsic parameters from some camera calibration software, and
the desired zNear and zFar clipping planes of the view frustum, compute and
return a projection matrix for use as GL_PROJECTION_MATRIX for OpenGL rendering
with a virtual pinhole camera that approximates the properties of the real camera.

Parameters:

cx = Optical sensor center in pixels.
cy = Optical sensor center in pixels.
fx = Focal length in units of pixels in x direction.
fy = Focal length in units of pixels in y direction.
zNear = Near clipping plane.
zFar = Far clipping plane.

Returns the 4-by-4 GL_PROJECTION_MATRIX.

Path   Retrieve current version from GitHub | View changelog
Psychtoolbox/PsychOpenGL/PsychCamIntrinsicsToGLProjectionMatrix.m