RE: rotates and then translates??

New Message Reply Date view Thread view Subject view Author view

William Briggs (stimpy++at++niesten.arc.nasa.gov)
Wed, 24 Nov 93 08:49:03 -0800


The man page for pfDCS states:
  When independently setting translation, rotation, and scale, the pfDCS
  matrix is computed as S*R*T, where S is the scale, R is the rotation,
  and T is the translation.

If you want to override this, you can create the matrix yourself:
  pfMakeEulerMat( myrotation, heading, pitch, roll );
  PFMAKE_TRANS_MAT( mytranslation, obj->trans[0], obj->trans[1], \
    obj->trans[2] );
  pfMultMat( mytransform, mytranslattion, myrotation ); // Rot then Trans

In fact, I have used this to override the order of the rotations as well:
  pfMakeEulerMat( rotate1, roll, 0.0f, 0.0f ); // Roll about heading axis
  pfMakeEulerMat( rotate2, 0.0f, pitch, 0.0f );
  pfMakeEulerMat( rotate3, 0.0f, 0.0f, heading ); // Yaw around roll axis
  pfMultMat( myrotation, rotate2, rotate3 ); // Roll then pitch...
  pfPreMultMat( myrotation, rotate1 ); //...then yaw

--------------------------------+------------------------------------------
William Briggs |"Monday, I could wait till
NASA Ames Research | Tuesday. If I make up my mind.
(415) 604-6438 | Wednesday would be fine,
--------------------------------+ Thursday's on my mind.
MailStop 262-2 | Friday'd give me time,
PO Box 1000 | Saturday could wait. But
Moffett Field, CA 94035-1000 | Sunday'd be too late." -Sting
--------------------------------+------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:06 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.