title: Back-projecting from 3x4 matrix to world coordianates
body: <p>I have a 3x4 projection matrix <strong>P</strong> that given a point in world coordinates (homogeneous) <strong>w</strong> =[x,y,z,1], projects the point into image space; <strong>P*w=[x,y,w]</strong> where <strong>[x/w,y/w]</strong> are pixel coordinates and <strong>w</strong> is interpreted as the signed distance to image plane.</p>
  <p>I would like to be able to un-project a pixel back to world coordinates (as a ray w/ distance for specific point). For example to back-project pixels [0,0] and [width-1,height-1] etc to get view frustum corners in world coordinates.</p>
  <p>I've added a <strong>[0,0,0,1]</strong> vector to the bottom of the <strong>P</strong> matrix to make it squared 4x4(homogeneous?) matrix, which I then inverted. The inverse matrix seems to work fine in few examples I've tried - but I don't understand why, or if it is a valid approach? Thanks!</p>