# [vtkusers] Converting into the Eye position, Look at point and up Vector notation

Michael Scarpa m.scarpa at uva.nl
Mon Jun 19 04:20:59 EDT 2006

```On Sun, Jun 18, 2006 at 02:50:45PM +0100, Chris Hughes wrote:
> I am overall looking for a method to convert from the transformation matrix
> used in the ARToolkit to the 'Eye position', 'Look at point' and 'up Vector'
> notation that I am used to using in VTK. I can convert the matrix into an
> OpenGL transformation matrix if it is easier to convert from there?
>
> Can anyone point me in the right direction or point me towards more
> information about the 'Eye position', 'Look at point' and 'up Vector'
> notation?

The camera in VTK has three important aspects (in this context): the
position (which I guess is what you mean by "Eye position"), the focal
point (again my guess that that's what you mean by "Look at point") and
the up vector.  The position is (obviously) the point in space where the
camera is located, i.e. from where the camera looks onto the scene.  The
focal point is the position to where the camera is looking.  Another way
to describe that is to set the direction of projection
(vtkCamera::SetDirectionOfProjection()), which will describe the vector
from the position to the focal point.  Finally, view up is a vector that
tells us where the "top" of the camera (and hence of the image produced
by the camera) points to.  So in the end, all you need to do is to set
up these three parameters such that they match the default value of the
ARToolkit and then apply the matrix of the ARToolkit to them.  If, for
example, the ARToolkit assumes that the camera sits at the position (0,
0, 0), points down the negative Z axis (direction of projection = (0, 0,
-1)) and "up" is along the positive Y axis (up vector = (0, 1, 0)), then
after setting these values for your camera you can simply multiply each
of them with the matrix you got from the ARToolkit (making sure the
notation is conform to VTK if you do all this in VTK).  I hope this
helps.  Make sure to check out the online documentation about vtkCamera
objects. All the things I've mentioned here come from there, so if
anything is unclear you will most certainly find more in the
documentation.

One last note: I am not familiar with  the ARToolkit and so I am not
sure if the matrix it returns to you is the matrix describing the
transformation from the marker to the camera or from the camera to the
marker.  Depending on this you might need to invert the matrix provided
by the ARToolkit before applying it to the camera.  Also: you might use
the transform as "user transform" for the camera to transform all the
important values in one go!

Kind regards,

Michael

```