[vtkusers] vtkTransform and Rotations !!

Sebastien Auclair sxa at fluent.com
Thu Mar 27 15:44:12 EST 2003


Glen,

I just tested your python code (in python) and its not working !

Try again but with the initial values i introduced (90, 90, 0) :

>>> from vtkpython import *
>>> a = vtkTransform()
>>> a.RotateZ(0)
>>> a.RotateX(90)
>>> a.RotateY(90)
>>> print a.GetOrientation()
(90.0, 0.0, 90.0)
>>>

Thanks !
_________________________________
Seb


----- Original Message -----
From: "Glen Lehmann" <glehmann at imaging.robarts.ca>
To: "Sebastien Auclair" <sxa at fluent.com>
Cc: <vtkusers at public.kitware.com>
Sent: Thursday, March 27, 2003 3:33 PM
Subject: Re: [vtkusers] vtkTransform and Rotations !!


> I suspect it's because you've explicitly set the PostMultiply Flag,
> which will of course chage the order the rotations are applied.  Using
> the default PreMultiply, here's the output of a python test I just ran.
>
>  >>> from vtkpython import *
>  >>> a = vtkTransform()
>  >>> a.RotateZ(90)
>  >>> a.RotateX(40)
>  >>> a.RotateY(10)
>  >>> print a.GetOrientation()
> (40.0, 10.0, 90.0)
>
> Sebastien Auclair wrote:
>
> >Hum... That too isn't working....
> >
> >Then i get :
> >
> >X= 1.27222e-014
> >Y= 90
> >Z= -90
> >...again from initial angles:
> >X=90
> >Y=90
> >Z=0
> >
> >Thanks !
> >____________________________________
> >Seb
> >
> >----- Original Message -----
> >From: "Glen Lehmann" <glehmann at imaging.robarts.ca>
> >To: "Sebastien Auclair" <sxa at fluent.com>
> >Cc: <vtkusers at public.kitware.com>
> >Sent: Thursday, March 27, 2003 3:16 PM
> >Subject: Re: [vtkusers] vtkTransform and Rotations !!
> >
> >
> >
> >
> >>Hi Sebastien,
> >>
> >>vtkTransform performs rotations in the ZXY order.  If you do something
> >>
> >>
> >like;
> >
> >
> >>newTransform->RotateZ(Rz);
> >>newTransform->RotateX(Rx);
> >>newTransform->RotateY(Ry);
> >>
> >>then GetOrientation() will will return what you expect.
> >>
> >>I hope this helps you out,
> >>Glen
> >>
> >>Sebastien Auclair wrote:
> >>
> >>
> >>
> >>>Hi folks !
> >>>
> >>>I need to create a rotation matrix for x,y and z . (Please note that we
> >>>aren't using vtkActor for transformation...neither vtkWindowInteractor
> >>>
> >>>
> >...)
> >
> >
> >>>I have read every post in the usergroup's repository and nothing really
> >>>helped.
> >>>
> >>>The problem is that GetOrientation never produces to correct result.
> >>>
> >>>This is essentially how I do it :
> >>>##################################################################
> >>>vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
> >>>vtkTransform* newTransform = vtkTransform::New();
> >>>newTransform->Identity();
> >>>newTransform->PostMultiply();
>
>>>newTransform->Translate(-(m_origin[0]), -(m_origin[1]), -(m_origin[2]));
> >>>
> >>>newTransform->RotateWXYZ(y, 0,1,0);
> >>>newTransform->RotateWXYZ(x, 1,0,0);
> >>>newTransform->RotateWXYZ(z, 0,0,1);
> >>>newTransform->Translate((m_origin[0]), (m_origin[1]), (m_origin[2]));
> >>>float test[3] ;
> >>>newTransform->GetOrientation(test);
> >>>##################################################################
> >>>For exemple,  if we try to rotate with (X=90, Y=90, Z=0), we get
> >>>
> >>>
> >orientation
> >
> >
> >>>(X=90, Y=0, Z=90).
> >>>And what is the difference between RotateX and RotateWXYZ (a, 1, 0, 0)
> >>>??????
> >>>
> >>>
> >>>Thanks for any help.
> >>>___________________________________________________
> >>>Seb
> >>>
> >>>_______________________________________________
> >>>This is the private VTK discussion list.
> >>>Please keep messages on-topic. Check the FAQ at:
> >>>
> >>>
> ><http://public.kitware.com/cgi-bin/vtkfaq>
> >
> >
> >>>Follow this link to subscribe/unsubscribe:
> >>>http://public.kitware.com/mailman/listinfo/vtkusers
> >>>
> >>>
> >>>
> >>>
> >>>
> >>_______________________________________________
> >>This is the private VTK discussion list.
> >>Please keep messages on-topic. Check the FAQ at:
> >>
> >>
> ><http://public.kitware.com/cgi-bin/vtkfaq>
> >
> >
> >>Follow this link to subscribe/unsubscribe:
> >>http://public.kitware.com/mailman/listinfo/vtkusers
> >>
> >>
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://public.kitware.com/mailman/listinfo/vtkusers
> >
> >
> >
>




More information about the vtkusers mailing list