[vtkusers] Relative Rotation with VTK Transform

David Gobbi david.gobbi at gmail.com
Wed Feb 17 08:14:19 EST 2016


Thanks, I just had to be sure about the definition. Does this "rotation"
give a relative change from the previous position?

I'm about 70% certain that you should be using PostMultiply.  And if it's
rotating around the wrong axis, that implies that you are applying the
rotation in the wrong frame of reference.

So, if the current pose matrix of the bunny is "M" and the transform from
the quaternion is T, then maybe you should be applying the transform
M*T*Inverse(M) to the actor.

 - David

On Wed, Feb 17, 2016 at 1:58 AM, Lonni Besançon <lonni.besancon at gmail.com>
wrote:

> Hello David, thanks for answering and thanks for your time.
>
> For the elements of rotations, this is what I get from google in their
> documentation.
> /Orientation, as a quaternion, of the pose of the target frame with
> reference to to the base frame.
> Specified as (x,y,z,w) where RotationAngle is in radians:
>
>  x = RotationAxis.x * sin(RotationAngle / 2)
>  y = RotationAxis.y * sin(RotationAngle / 2)
>  z = RotationAxis.z * sin(RotationAngle / 2)
>  w = cos(RotationAngle / 2)/
>
> So the rotation I use is this one. It is from a special kind of tablet and
> special sensors.
> Therefore rotation[3] is my w, and since the coordinate system is not the
> same, I had to switch the axis parts of rotation.
> I think the basic operations that I do with rotation and RotateWXYZ are ok,
> because if I always go back to my original position, all the rotations are
> correctly mapped to my actor. However, combining rotations is what triggers
> weird and unexpected rotation (i.e not on the correct axis).
>
> Thanks for the tip on the memory leak, and thanks again for your time.
>
> Lonni
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160217/0f662051/attachment.html>


More information about the vtkusers mailing list