[vtkusers] VTK and the SpaceNavigator

hedicu hedicu at gmail.com
Mon Jul 16 10:46:25 EDT 2007


Hello all,

currently i'm trying to connect the spacenavigator to vtk in order to
navigate through a 3d scene simulating a camera. so, i want to map the
spacenavigator inputs to the camera parameters. Unfortunately the methods
that the vtkCamera provides do not help, since the objects are moving and
not the camera. 

So, what i think i need is a transformation matrix which multiplied by the
up and direction vector of the camera provides the correct results. My first
attempt was the multiplication of the rotation matrices around the x y and z
axes and the inverse of this matrix is the transformation matrix that i use
currently to multiply by the coordinate system of the camera (i.e. up and
direction vectors, the right vector is just the cross product of dir and
up). Then, i orthogonalize this coordinate system and derive the focal point
from the camera position and the direction vector. I set the resulting point
in the SetFocalpoint method of the vtkCamera, but unfortunately i don't get
the desired results completely.

Am i fully wrong? Is there an easier method to do this?

And a second weird question... when i insert some printf's in the program,
why does e.g. the object position in the scene change?

I hope the questions are more or less clear, otherwise, just let me know.

Thanks!

Hector.
-- 
View this message in context: http://www.nabble.com/VTK-and-the-SpaceNavigator-tf4086688.html#a11615406
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list