[vtkusers] angle between planes[newbie question]

David Gobbi david.gobbi at gmail.com
Sat Apr 9 19:39:33 EDT 2016


On Sat, Apr 9, 2016 at 4:58 PM, c_mihai via vtkusers <vtkusers at vtk.org>
wrote:

> Hello and thank you for replying David.
>
> Indeed, I should of explained what I meant by X,Y,Z better. They are meant
> to be degree's I would need to rotate the X,Y and Z axis in order for the
> planes to be parallel.
>

You would have to rotate by the angle that I gave in my first reply, around
the axis that I gave in my first reply.

If you want to know the answer in terms of the needed rotations around the
X,
Y, and Z axes then the solution becomes a lot more complicated.  You would
need to specify the order in which you want these rotations to occur,
because
rotations are in general not commutative.

In VTK you could do something like this, given the axis and angle that I
previously mentioned:

    vtkSmartPointer<vtkTransform> transform =
      vtkSmartPointer<vtkTransform>::New();
    transform->RotateWXYZ(vtkMath::DegreesFromRadians(angle), axis);

    double angles[3];
    transform->GetOrientation(angles);

This will give you the rotation angles around X, Y, and Z but unfortunately
the
VTK documentation does not say what order the rotations occur in.  I think
it
it is Y, X, and then Z but I'm not certain.

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160409/7e1d471a/attachment.html>


More information about the vtkusers mailing list