[vtkusers] vtkCamera->GetOrientation() clarification.

Guillermo Valin guillermo at kboom.cl
Wed Feb 1 06:22:06 EST 2012


Hi all,

I've been trying to implement a command to rotate the plot a specified
number of degrees from a specified axis, basically it is:

rotate_plot -x degrees -y degrees -z degrees

And internally performs the commands RotateX(xDegrees), RotateY(yDegrees)
and RotateZ(zDegrees), to perform undo I just need to do the same rotations
in the inverse order with the negative values of the angles and it works
fine too, I can see the structure rotating the specified degrees in the
specified axis (testing with trivial numbers, like 45, 90, 180, etc).

But the problem is that I want to do the same with user interaction of the
mouse, for that I'm using a derived class of vtkInteractorStyle. When I
start from a (0,0,0) degrees reference, and rotate the plot on (45,45,45)
degrees, I can see the structure rotate the specified degrees correctly,
but the camera->GetOrientation() will give me another value totally
different, in this case (58.6003, -16.3249, 73.6751) degrees, when I expect
to see (45, 45, 45).

I even can rotateZ -45, rotateY -45, rotateX -45 and I will go back to
(0,0,0), but camera->GetOrientation() shows totally different values.

Is there any way to obtain the degrees of rotation of the structure when
using mouse interaction so I can use them directly on transform->RotateX,
RotateY and RotateZ for my command?

Thanks in advance,
-- 
Guillermo Valin
Importadora KBOOM Limitada - Tecnología Explosiva!
w: http://www.kboom.cl <> e: guillermo at kboom.cl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120201/b1b483aa/attachment.htm>


More information about the vtkusers mailing list