WOW! This is really quite elegant.
You could have made your life a lot easier though, if you had used the TikZ 3D coordinate system, defined as \draw (0,1,2)--(2,3,4);
and, if needed, adjusting the x,y and z coorinates by \begin{tikzpicture}[x={(1cm,0cm)},y={(0cm,1cm)},z={(0.73cm,0.73cm)}]
or something alike.
This changes the lengths with which the x,y and z are projected onto x and y.
As an alternative, you could have used thetikz-3dplot
package to rotate your camera perspective about azimuth and elevation. Really just a two liner:
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords]
for 70 degree azimuth and 110 degree of elevation.
When rotating, you have to remember though, that TikZ has no real 3D support, as in:
z-buffering is not (yet?) supported. You might therefore have to adjust some colors after rotation. This is because, with rotation, the drawing order can change. Then things are in front of others, because of the time they are calculated, not where they are in 3D. This is explained in the tikz3dplot example manual, chapter 3.3.
Also, the use of relative coordinates helps to focus on the contents, rather than the creation of the figure. \draw (2,3,4)--++(0,0,1);
takes you towards z by one, from where you used to be.
On a rather unrelated note, you should load the TikZ-packages in the preamble, otherwise you would have to reload them in every scope. This would slow down compilation speed, for larger documents.
Best Answer
The
pstricks
manual says on page 6:So you should be able to use:
to get the width of
4.2
in thepstricks
coordinate system. However, if you using complex transformations this might not work correctly, I guess. You can set the units using\psset{xunit=1cm}
etc.