1

See the following MWE

\documentclass[pstricks,border=0pt]{standalone}
\usepackage{pst-solides3d}
\usepackage{fp}
\begin{document}
\multido{\ra=10+2,\rb=1.8+0.2,\rc=0.7+0.1,\rd=60+-5,\rg=10+1}{5}%
{% 
\FPupn{coordA}{\ra}
\FPupn{coordB}{\rb}
\FPupn{coordC}{\rc}
\FPupn{coordD}{\rd clip}
\FPupn{coordG}{\rg clip}
    \begin{pspicture}(-6,-5)(6,8)
    \rput(0,0){%
            \begin{pspicture*}(-6,-5)(6,8)
             \psset{RotZ=\coordA}
             % \psset{viewpoint=60 25 30,Decran=60,lightsrc=viewpoint,solidmemory}
             %
             % \psset{viewpoint=60 25 30,Decran=60,lightsrc=viewpoint,solidmemory} % work
             \psset{viewpoint=\coordD 25 30,Decran=60,lightsrc=\coordG 0 10,solidmemory} % does not work
             \psSolid[object=anneau,h=1.8,R=4.4,r=3.8,name=A1,action=none,color1=black!50,color2=black!20,hue=(color1) (color2)](0,0, .97)% no action, name=A1
             \psSolid[object=anneau,h=0.7,R=5,r=4.4,name=A2,action=none](0,0,0.46)%          no action, name=A2
             \psSolid[object=fusion,base=A1 A2]
            \end{pspicture*}%
            }%
    \end{pspicture}%
}%  
\end{document}

I am going to compile via

set fn=animate-3d-view

latex --enable-write18 --src -interaction=nonstopmode --save-size=80000 %fn%.tex
dvips -P pdf -D1200 %fn%.dvi
ps2pdf %fn%.ps

timeout /t 30

System: Windows 7, MiKTeX

It seems, that I cannot use variables for psset or I have to do it in another way.

Best Regards

Peter Ebelsberger

1

Solution is the use of \pstVerb which can be used to inject values to psset.

\documentclass[pstricks,border=0pt]{standalone}
\usepackage{pst-solides3d}
\usepackage{fp}
\begin{document}
\multido{\ra=10+2,\rb=1.8+0.2,\rc=0.7+0.1,\rd=60+-5,\rg=10+1}{5}%
{% 
\FPupn{coordA}{\ra}
\FPupn{coordB}{\rb}
\FPupn{coordC}{\rc}
\FPupn{coordD}{\rd clip}
\FPupn{coordG}{\rg clip}
%
\pstVerb{/coordA \coordA\space def}%
\pstVerb{/coordB \coordB\space def}%
\pstVerb{/coordC \coordC\space def}%
\pstVerb{/coordD \coordD\space def}%
\pstVerb{/coordG \coordG\space def}%
%
    \begin{pspicture}(-6,-5)(6,8)
    \rput(0,0){%
            \begin{pspicture*}(-6,-5)(6,8)
             \psset{RotZ=\coordA}
             % \psset{viewpoint=60 25 30,Decran=60,lightsrc=viewpoint,solidmemory}
             %
             % \psset{viewpoint=60 25 30,Decran=60,lightsrc=viewpoint,solidmemory} % work
             \psset{viewpoint=coordD 25 30,Decran=60,lightsrc=coordG 0 10,solidmemory} % does not work
             \psSolid[object=anneau,h=1.8,R=4.4,r=3.8,name=A1,action=none,color1=black!50,color2=black!20,hue=(color1) (color2)](0,0, .97)% no action, name=A1
             \psSolid[object=anneau,h=0.7,R=5,r=4.4,name=A2,action=none](0,0,0.46)%          no action, name=A2
             \psSolid[object=fusion,base=A1 A2]
            \end{pspicture*}%
            }%
    \end{pspicture}%
}%  
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.