How calculate camera target position, if I have front/back planes, camera transformation matrix and camera lens length?
-
\$\begingroup\$ I mean a point of camera target (x,y,z). Look on the picture. \$\endgroup\$SomeGenericNameto_Display– SomeGenericNameto_Display2016-06-16 21:33:32 +00:00Commented Jun 16, 2016 at 21:33
-
\$\begingroup\$ What do you mean by "target position"? Intersection of forward vector with far plane? \$\endgroup\$wondra– wondra2016-06-16 21:48:36 +00:00Commented Jun 16, 2016 at 21:48
1 Answer
You can't.
This is assuming that you have used the following function
void gluLookAt(GLdouble eyeX,
GLdouble eyeY,
GLdouble eyeZ,
GLdouble centerX,
GLdouble centerY,
GLdouble centerZ,
GLdouble upX,
GLdouble upY,
GLdouble upZ);
to get your transformation matrix, and that you want to find what values were used for center parameters.
The lookat method will give you a matrix that is good to transform the camera position, but will use 'clean' values for it: it will at least normalize the center-eye vector.
If you want to keep track of what is the 'center' of the camera, keep it in a variable, and use that variable instead.
(Doc)