[vtkusers] vtkTransform and Rotations !!

Sebastien Auclair sxa at fluent.com
Thu Mar 27 14:57:03 EST 2003


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




More information about the vtkusers mailing list