请参阅以下 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}
我将通过以下方式进行编译
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
系统:Windows 7,MiKTeX
看来,我不能对 psset 使用变量,或者我必须以其他方式进行。
此致
彼得·埃贝尔斯伯格
答案1
解决方案是使用 \pstVerb,它可用于向 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}