[pstricks] vanishing plane as function of viewpoint

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Jun 9 18:28:34 CEST 2012


Am 09.06.2012 17:28, schrieb Jon Joseph:
> Once again I am doing battle with the pst-solides3d package.  Can someone explain to me why the tangent plane vanishes when I change the viewpoint?

> \psSolid[object=plan,  definition=equation, fillcolor=Aquamarine, args={[0 1 0 0] }, base=-3 3 -4 0]  % Tangent plane

that plane has only _one_ visible face, the one on the back is
_not_ visible by definition. You change the viewpoint in a way
that the plane is seen from it's back side which is not visible.
Change the definition of the plane so that it's direction vector
points to the viewpoint, eg args={[0 -1 0 0] 180}:

\documentclass{article}
\usepackage[svgnames]{pstricks}
\usepackage{pst-solides3d}
\begin{document}
% With this viewpoint everything draws correctly

\psset{viewpoint=30 10 30, Decran=50}
\begin{pspicture}[showgrid=false](-1.5,-3)(6.5,6)
\psSolid[object=grille,base=-3 3 -1 6,action=draw**,fillcolor=gray!20]
\defFunction[algebraic]{G5}(t){t}{0.5*t^2}{0}
\defFunction[algebraic]{G6}(t){t}{0.5*t^2}{4}
\psSolid[object=plan,definition=equation,fillcolor=Aquamarine,
   incolor=black!10,args={[0 1 0 0] }, base=-3 3 -4 0]  % Tangent plane
\psSolid[object=cylindre,range=-3 2,h=4,function=G5,axe=0 0 1,
   incolor=cyan!50, fillcolor=yellow!50, ngrid=3 8]
\axesIIID(0,4.5,0)(4,6,5)
\end{pspicture}
% Changed the viewpoint and the plane disappears

\psset{viewpoint=30 -10 30, Decran=50}
\begin{pspicture}[showgrid=false](-1.5,-3)(6.5,6)
\psSolid[object=grille,base=-3 3 -1 6,action=draw**, fillcolor=gray!20]
\defFunction[algebraic]{G5}(t){t}{0.5*t^2}{0}
\defFunction[algebraic]{G6}(t){t}{0.5*t^2}{4}
\psSolid[object=cylindre, range=-3 2,h=4, function=G5, axe=0 0 1,
   incolor=cyan!50, fillcolor=yellow!50, ngrid=3 8]
\psSolid[object=plan,definition=equation, fillcolor=Aquamarine,
   args={[0 -1 0 0] 180}, base=-3 3 -4 0]
\axesIIID(0,4.5,0)(4,6,5)
\end{pspicture}

\end{document}

Herbert


More information about the PSTricks mailing list