# PSTricks 3D drawing — tweaking of parameters

Consider the following code:

\documentclass{article}

\usepackage{pst-solides3d}

\begin{document}

\psset{viewpoint = 15 -30 11, Decran = 10}
\begin{pspicture}[solidmemory](-8.25,-1)(5.3,2.05)
\psSolid[object = point, args = 15.5 3 7.3, name = L]
\psSolid[object = point, args = -55 2 3.5,  name = R]
\psSolid[object = line, linecolor = red!50, linestyle = dashed, linewidth = 2pt, args = R L]
\psSolid[object = parallelepiped, a = 6.0, b = 6.0, c = 6.5, RotZ = -15, fillcolor = blue!50, name = parallelepipedum, action = draw*](0 0 1.5)
\multido{\iA = 0+1}{8}{%
\psSolid[object = point, linecolor = black, definition = solidgetsommet, args = parallelepipedum \iA, name = C\iA]
\psset{object = line, linecolor = darkgray!50, linestyle = dotted}
\psSolid[args = L C\iA]
\psSolid[args = R C\iA]
}
\psSolid[object = parallelepiped, a = 6.0, b = 6.0, c = 6.5, RotZ = -15, name = parallelipipidum, action = draw](0 0 1.5)
\multido{\iB = 0+1}{4}{%
\psSolid[object = point, definition = solidgetsommet, args = parallelipipidum \iB, name = Top\iB, action = none]
}
\psSolid[object = line, args = Top0 Top2]
\psSolid[object = line, args = Top1 Top3]
\psSolid[object = point, definition = solidcentreface, args = parallelipipidum 0]
\end{pspicture}

\end{document}


Can someone help me tweak the parameters to get each pair of the dashed, gray lines to lie perfectly on top of each other.

I've tried a long time but I'm in the dark. :(

I should point out that the parameters in question are args = 15.5 3 7.3, args = -55 2 3.5, and a = 6.0, b = 6.0, c = 6.5, RotZ = -15. (The values of a, b, c, and RotZ should be the same for the two objects.)

1. The vanishing points for lines that are parallel to the ground lie at eye level, so the z position of the point objects needs to be equal to the z value of the viewpoint.
2. The vanishing points for lines pointing in a horizontal angle theta lie at x=tan(theta)*yv + xv, where yv and xv are the x and y components of the viewpoint.
3. The vanishing points lie on the horizon line, which is at y=0.

So, for a viewpoint of 15 -30 11 and a rotation of the cuboid of -15 degrees, the vanishing points lie at 23.04 0 11 and -96.96 0 11:

\documentclass{article}

\usepackage{pst-solides3d}

\begin{document}

\psset{viewpoint = 15 -30 11, Decran = 6}
\begin{pspicture}[solidmemory](-8.25,-1)(5.3,2.05)
\psSolid[object = point, args = 23.04 0 11, name = L]
\psSolid[object = point, args = -96.96 0 11,  name = R]
\psSolid[object = line, linecolor = red!50, linestyle = dashed, linewidth = 2pt, args = R L]
\psSolid[object = parallelepiped, a = 8.0, b = 8.0, c = 8.5, RotZ = -15, fillcolor = blue!50, name = parallelepipedum, action = draw*](0 0 1.5)
\multido{\iA = 0+1}{8}{%
\psSolid[object = point, linecolor = black, definition = solidgetsommet, args = parallelepipedum \iA, name = C\iA]
\psset{object = line, linecolor = darkgray!50, linestyle = dotted}
\psSolid[args = L C\iA]
\psSolid[args = R C\iA]
}
\psSolid[object = parallelepiped, a = 8.0, b = 8.0, c = 8.5, RotZ = -15, name = parallelipipidum, action = draw](0 0 1.5)
\multido{\iB = 0+1}{4}{%
\psSolid[object = point, definition = solidgetsommet, args = parallelipipidum \iB, name = Top\iB, action = none]
}
\psSolid[object = line, args = Top0 Top2]
\psSolid[object = line, args = Top1 Top3]
\psSolid[object = point, definition = solidcentreface, args = parallelipipidum 0]
\end{pspicture}

\end{document}