[vtkusers] Question on manual configuration of VTK camera

David Gobbi david.gobbi at gmail.com
Thu Dec 8 13:10:00 EST 2011


Take a look at the code for the SetupCamera method in
VTK/Common/vtkPerspectiveTransform.cxx

By reverse engineering that code, you can get the camera parameters
from the matrix (assuming it is a rigid-body matrix, i.e. no scale, shear,
or perspective).  It should work more-or-less like this:

1) invert the view matrix
2) the 2nd column of the inverse matrix is the view up
3) the 3rd column of the inverse matrix is the normalized
  focus-to-position vector
4) the 4th column of the inverse matrix is the position

So it doesn't give the focal point, but you can compute the focal point
if you know the distance.

 - David

On Thu, Dec 8, 2011 at 10:17 AM, dev <work2compilation at gmail.com> wrote:
> Hi everyone,
>
> I had to configure the VTK camera manually. So for that I have the external
> matrices and internal.
> As I far as I understand I have to configure three main method of vtkCamera
> class:
>
> *1-SetPosition( , , )
> 2-SetFocalPoint( , , )
> 3-SetViewUp ( , , )*
>
> My external matrices are:
>
> *Rotation:*
>  0.016   -0.990    0.142
> -0.980   -0.044   -0.192
>  0.197   -0.136   -0.971
>
> *Translation:*
>  0.054
>  -0.725
>  3.794
>  1.000
>
> *Now I have two questions *:
> 1-How can I use this external matrices to configure the three methods?
> 2-These methods are enough to configure the camera manually, or should I
> configure others?
>
> Could you help me please? I'm stuck on this since several days.
>
> I thank you for your attention
>



More information about the vtkusers mailing list