# [pstricks] pst-3dplot problem with RotX, ...

Patrice MEGRET Patrice.MEGRET at umons.ac.be
Tue Oct 20 13:44:23 CEST 2020

Dear Herbert,

I am using pst-3dplot to illustrate Cartesian basis transformation. See bottom of the mail for the full example with the problem.

So I have plotted one set of axes with:
\pstThreeDCoor[linecolor=red,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1$,nameY=$2$,nameZ=$3$]

and a second set of axes by:
\pstThreeDCoor[linecolor=blue,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1'$,nameY=$2'$,nameZ=$3'$%
RotSequence=xyz,eulerRotation=false,RotX=30,RotZ=45]

As I have not used \psset to set RotSequence=xyz,eulerRotation=false,RotX=30,RotZ=45 globally, I suppose that the coordinates are always referred to the one issued initially.
So
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=green!50!black,linewidth=2.5pt]{->}(0,0,0)(0,1,0)
always display a dot and a vector in the unrotated coordinates systems.

But if I change the order of  \pstThreeDDot{} and \pstrThreeDLine{}, the vector uses the rotated coordinates but not the dot.
Moreover, if there is a vector after the dot, then the coordinates for the vector become the initial ones.

I suspect a problem within \pstThreeDLine{} because I made also test with \pstThreeDBox[hiddenLine](0,0,0)(4,0,0)(0,6,0)(0,0,3), \pstThreeDNode{}  that use the initial coordinates.

To solve the probem, I did the following:
\psset{RotSequence=xyz,eulerRotation=false,RotX=30,RotZ=45}
\pstThreeDCoor[linecolor=blue,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1'$,nameY=$2'$,nameZ=$3'$]
\pstThreeDLine[linecolor=green!50!black,linewidth=2.5pt]{->}(0,0,0)(0,1,0)
\pstThreeDDot(1,0,0)
So that I use the new coordinates after the \psset. It it the good way, or should I use RotSet key somewhere.

Full working example:
\documentclass{report}

\usepackage{pstricks}
\usepackage{pst-3dplot}

\begin{document}

\begin{pspicture}[showgrid=false](-3,-4)(7,4.5)
\psset{unit=1,Alpha=75,Beta=30}
\pstThreeDCoor[linecolor=red,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1$,nameY=$2$,nameZ=$3$]
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=red!50!black,linewidth=2.5pt]{->}(0,0,0)(0,0,1)

\pstThreeDCoor[linecolor=blue,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1'$,nameY=$2'$,nameZ=$3'$,%
RotSequence=xyz,eulerRotation=false,RotX=30,RotZ=45]
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=green!50!black,linewidth=2.5pt]{->}(0,0,0)(0,1,0)
\pstThreeDLine[linecolor=blue!50!black,linewidth=2.5pt]{->}(0,0,0)(1,0,0)
\end{pspicture}

\begin{pspicture}[showgrid=false](-3,-4)(7,4.5)
\psset{unit=1,Alpha=75,Beta=30}
\pstThreeDCoor[linecolor=red,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1$,nameY=$2$,nameZ=$3$]
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=red!50!black,linewidth=2.5pt]{->}(0,0,0)(0,0,1)

\pstThreeDCoor[linecolor=blue,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1'$,nameY=$2'$,nameZ=$3'$,%
RotSequence=xyz,eulerRotation=false,RotX=30,RotZ=45]
\pstThreeDLine[linecolor=green!50!black,linewidth=2.5pt]{->}(0,0,0)(0,1,0)
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=blue!50!black,linewidth=2.5pt]{->}(0,0,0)(1,0,0)
\end{pspicture}

\begin{pspicture}[showgrid=false](-3,-4)(7,4.5)
\psset{unit=1,Alpha=75,Beta=30}
\pstThreeDCoor[linecolor=red,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1$,nameY=$2$,nameZ=$3$]
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=red!50!black,linewidth=2.5pt]{->}(0,0,0)(0,0,1)

\psset{RotSequence=xyz,eulerRotation=false,RotX=30,RotZ=45}
\pstThreeDCoor[linecolor=blue,xMax=7,yMax=6.5,zMax=4.5,%
nameX=$1'$,nameY=$2'$,nameZ=$3'$]
\pstThreeDLine[linecolor=green!50!black,linewidth=2.5pt]{->}(0,0,0)(0,1,0)
\pstThreeDDot(1,0,0)
\pstThreeDLine[linecolor=blue!50!black,linewidth=2.5pt]{->}(0,0,0)(1,0,0)
\end{pspicture}

\end{document}

Best regards,
Patrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/pstricks/attachments/20201020/127a278d/attachment-0001.html>