Let's assume I have "look-at" and "perspective" matrices. Now I need to compute a world 3D-point from a corresponding on-camera 2D-point and the distance between the camera and the former.
AFAIK, the reverse problem can be solved easily: point2D = lookAt * perspective * point3D
. This means that point3D = (lookAt * perspective)^-1 * point2D
. But it's not clear for me where the distance is to be applied here, and what are the "additional" values of the points, i.e. what are the values designated with the question marks (x, y, z, ?)
and (x, y, ?, ?)
. I guess those values (or some of them) can be derived from the distance?
Or maybe this task can't be reversed this way? If so how can I solve it without diving too deep into geometry?