title: How to create perspective projection matrix, given focal points and camera principal center
body: <p>I managed to acquire camera's intrinsic and extrinsic parameters using OpenCV, thus I have fx, fy, cx and cy. And I also have the screen / image's width and height.</p>
  
  <p>But how do I create an OpenGL perspective projection matrix from these parameters?</p>
  
  <p>glFrustrum shows how to create projection matrix, given Z near, Z far and the image width and height. But how do I include focal points and camera centers in this matrix?</p>
  
  <p><img src="https://i.stack.imgur.com/zPcST.png" alt="enter image description here"></p>