This is clearly a Photogrammetry problem which is not simple. Photogrammetry is taught in one, two or three classes (1-3 semesters) in technical universities.
At first, a straight line in 3dimensional space is projected as a (2dimensional) straight line in the image shot by the camera (and this irrelevant to the orientation of the camera). If the 3D line is indeed straight, and the 2D is not, then the camera is not "metric", which means that it distorts the image. Luckily, the main causes of the distortion can be compensated for by the Direct Linear Transform method (DLT), in most still cameras. The same should be true for video cameras, though I have not verified it.
Second, if you have the x, y coordinates of a point on the image (2 knowns), it is impossible to compute the X,Y,Z space coordinates of the same point (3 knowns). In order to do that, you must have a second image, of different orientation, where the same point has x', y' coordinates (2 knowns more). Then you are able to compute the X,Y,Z coordinates - in theory. In practice the computation is difficult because it involves non-linear Least Square Method (LSM).
Instead of a second Image, you may know that the points of interest lie on a surface (perhaps the surface of the eye). In this case the points should satisfy the equation of the surface which is of the form f(X, Y, Z)=0. With this equation combined with x, y coordinates of one image, you are able to compute the X, Y, Z coordinates. Again, the computations are not simple.
Third, the DLT equations are defined as:
L1 X + L2 Y + L3 Z + L4
x = --------------------------
L9 X + L10 Y + L11 Z + 1
L5 X + L6 Y + L7 Z + L8
y = --------------------------
L9 X + L10 Y + L11 Z + 1
The Li coefficients are unknown and can be computed, if you have at least 6 control points. A control point is a point with known X, Y, Z (3D) coordinates and known x, y (2D) coordinates on the image.
Once you compute Li, you do the same with a second image, whose orientation is different to the first image. Thus:
L1' X + L2' Y + L3' Z + L4'
x' = -----------------------------
L9' X + L10' Y + L11' Z + 1
L5' X + L6' Y + L7' Z + L8'
y' = -----------------------------
L9' X + L10' Y + L11' Z + 1
Fourth, now that you have the Li and the Li' coefficients, you are finally able to compute the X, Y, Z coordinates of an arbitrary point whose projection to the first image is x, y and the projection to the second image is x', y'. You solve the 4 DLT equations for X, Y, Z.
As a last thought, you can use control curves instead of control points, but this a field of active research.