[pstricks] 3d plot - rotation of a point (x, y, z) via RotX, RotY, RotZ

Herbert Voss LaTeX at zedat.fu-berlin.de
Sun Jul 31 17:48:12 CEST 2005


Wim Neimeijer wrote:

> I tried to use the standard 3D rotation matrices I know, and try to map 
> this to the pst-3dplot where the rotation matrix M is used.
> 
> What I cannot figure out is the order in which the rotation operations 
> are done. What I mean is, is that in
> the call to \pstThreeDCoor[RotX=30,RotY=-15,RotZ=50, ...... I cannot 
> determine what the rotation sequence is
> 
> RotX, RotY , RotZ               or
> RotZ, RotY, RotX                or
> RotY, RotZ, RotX                etc

there is an option RotSequenz"... with a default of xyz.
And the definition is in pst-3dplot.pro


/RotXaxis {
   /yTemp y RotX cos mul z RotX sin mul sub def
   /z  y RotX sin mul z RotX cos mul add def
   /y yTemp def
} def
/RotYaxis {
   /xTemp x RotY cos mul z RotY sin mul add def
   /z  x RotY sin mul neg z RotY cos mul add def
   /x xTemp def
} def
/RotZaxis {
   /xTemp x RotZ cos mul y RotZ sin mul sub def
   /y  x RotZ sin mul y RotZ cos mul add def
   /x xTemp def
} def
/xyz { RotXaxis RotYaxis RotZaxis } def
/yxz { RotYaxis RotXaxis RotZaxis } def
/yzx { RotYaxis RotZaxis RotXaxis } def
/xzy { RotXaxis RotZaxis RotYaxis } def
/zxy { RotZaxis RotXaxis RotYaxis } def
/zyx { RotZaxis RotYaxis RotXaxis } def
%
/RotatePoint { RotSequence cvx exec } def
%

Herbert




More information about the PSTricks mailing list