# Cabinet projection in PSTricks (2)

I'd like to draw 3D-objects in cabinet projection with angle α=26.565° (i.e. atan(α) = 0.5) and scaling factor k=0.5590 = sqrt(5)/4, because the objects should be drawn on a grid, as in the left picture (2-1-coordinate system, from a math book on analytical geometry).

A related question is here (Cabinet projection in PSTricks). There Herbert proposes to use pst-3dplot.pro with coordType=5, but doing this I get five unwanted effects: (1) the scaling factor k is too small, (2) the axes are changed, I need y and z axes parallel to drawing plane, (3) to get the right angle for the z axis, I have to set Alpha=-153.435, and this results in a corresponding labeling of the axes, (4) the coordinate system is turned around clockwise 90 degrees, (5) the label „x“ of the horizontal axe is ON the axe, not above or below or besides it:

Minimal example:

\documentclass{article}
\usepackage{pst-3dplot}
\usepackage{auto-pst-pdf}
\begin{document}
\psset{coorType=5,Alpha=-153.435,IIIDxTicksPlane=xz}
\begin{pspicture} %(-2,-2)(3,3)
\psset{subgriddiv=2, gridlabels=0pt,    % grid
gridwidth=0.4pt, subgridwidth=0.4pt,
gridcolor=black!50, subgridcolor=black!50}
\psgrid(-4,-3)(6,6) %(x2,y2)
\pstThreeDCoor[xMin=0,xMax=5, yMin=0,yMax=5, zMin=0,zMax=5,%
IIIDticks,
IIIDlabels,drawing=true, %Alpha=90, %Beta=30,
linewidth=1.5pt,linecolor=red]
\end{pspicture}
\end{document}


Wolfgang Büchel

-

## 1 Answer

Try it with the pst-3dplot.pro from http://texnik.dante.de/dvips/pst-3dplot/ and the pst-3d-plot.tex from http://texnik.dante.de/tex/generic/pst-3dplot/ with the coorType=6.

\documentclass{article}
\usepackage{pst-3dplot}
\usepackage{auto-pst-pdf}
\begin{document}

\psset{coorType=6}
\begin{pspicture}(-3,-2)(6,6)
\psset{IIIDxTicksPlane=xz,IIIDyTicksPlane=yz}
\pstThreeDCoor[xMin=0,xMax=5, yMin=0,yMax=5, zMin=0,zMax=5,%
IIIDticks,spotX=0,
IIIDlabels=false,drawing=true,linewidth=1.5pt,linecolor=red,]
\multido{\iA=1+1}{4}{\footnotesize%
\pstThreeDPut(\iA,-0.3,0){\iA}
\pstThreeDPut(-0.3,\iA,0){\iA}
\pstThreeDPut(0,-0.3,\iA){\iA}}
\end{pspicture}

\end{document}


The angle is now set inside pstricks-3dplot.tex. If it is ok for you, I'll upload it to CTAN/TeXLive.

-
Thanks, @Herbert, that's a step forward, but some problems remain (please see the left picture above to see what I wanted): (1) The angle between x and z axes (in your picture above) should be 153.4349 degrees, not 135 degrees; (2) the scaling factor for (your) z axe should be 0.559; (3) the horizontal axe should be y, the vertical axe should be z, x comes into the front; (4) the labels of the axes should not be inclined, but parallel to the drawing plane. Wolfgang –  Wolfgang Büchel Jan 29 '14 at 17:06
for the scaling of the z axis search in the pro file for coorType 6. The you'll see that the z value is multiplied with 0.5. Choose 1 or another value and try it again. –  Herbert Jan 29 '14 at 18:27
OK, thanks again, @Herbert, after changing the lines in the pro file to coorType 6 le { % /x2D y x neg 0.559 mul Alpha cos mul add def /y2D z x neg 0.559 mul Alpha sin mul add def exit } if (to get the wanted k value and axis labeling) and setting the value of Alpha (in my tex file) to 26.565 degrees it's nearly perfect. Only two unwanted effects remain: (1) the labels of numbers on the axes are inclined (as in your picture above) (2) the coordinate system is rotated anti-clockwise around by 90 degrees. How can I get rid of these effects? - Wolfgang –  Wolfgang Büchel Jan 30 '14 at 6:35
case 1 needs some work to change the code and case 2 is a problem with a too clever ghostscript. Use -dAutoRotatePages=/None see (tug.org/PSTricks/main.cgi?file=pdf/pdfoutput#pst-pdf) or wait until you have some other text in your tex file then it will be correct, –  Herbert Jan 30 '14 at 8:20
see my edit. It makes more sense here to write the labels yourself. –  Herbert Jan 30 '14 at 9:08