[pstricks] Re : problem with pst-3d: rm=0 1

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Jan 11 12:27:44 CET 2012


Am 11.01.2012 10:58, schrieb Manuel Luque:

> \documentclass[11pt]{article}% run with xelatex or latex->dvips->ps2pdf
> \usepackage{pst-solides3d}
> \usepackage[a4paper]{geometry}
>
> \makeatletter
> \def\lightsource{
> \pstVerb{\pst at solides@viewpoint
> /PhI exch def /ThetA exch def /Dist exch def
> /Lx Dist ThetA cos mul PhI cos 1.0 mul mul def
> /Ly Dist ThetA sin mul PhI cos mul def
> /Lz Dist PhI sin mul def}%
> \psset{lightsrc=Lx Ly Lz}
> }
> \makeatother

I think we do not need the conversion for the lightsrc. It can be
done with rtp2xyz for the viewpoint or lightsrc=viewpoint rtp2xyz:

\documentclass[11pt]{article}
\usepackage{pst-solides3d}
\pagestyle{empty}
\begin{document}

\begin{center}
\psset{unit=1.0}
\begin{pspicture}(-5,-6)(8,6)
\pstVerb{/theta 3 5 atan def
          /tantheta 3 5 div def
          /rayon 3 tantheta mul def}%
\psset{viewpoint=50 -30 20 rtp2xyz,Decran=40,lightsrc=viewpoint}
\psframe[fillstyle=solid,fillcolor=blue!10](-4.5,-6)(8.5,6)%
\psSolid[object=grille,base=-4 5 -4 9,linecolor={[rgb]{0.72 0.72 
0.5}}](0,0,-5)
\defFunction{cone}(u,v){u v Cos mul}{u v Sin mul}{u}
\psSolid[object=cone,h=5,r=3,plansepare={[1 0 0 0]},name=ConeA,ngrid=18 
60,action=none,rm=0 579](0,0,-5)
\psSolid[object=cone,h=5,r=3,plansepare={[1 0 0 
0]},name=ConeB,RotY=180,ngrid=18 60,action=none,rm=0 579](0,0,5)
\psSolid[object=load,load=ConeA1,grid,fillcolor={[rgb]{0 .5 0}},
    incolor={[cmyk]{.1 .1 1 .1}},hollow,opacity=0.6]
\psSolid[object=load,load=ConeB1,grid,fillcolor={[rgb]{0 .5 0}},
    incolor={[cmyk]{.1 .1 1 .1}},hollow,opacity=0.6]
\psSolid[object=load,load=ConeA0,RotZ=90,grid,fillcolor={[rgb]{0 .5 0}},
    incolor={[cmyk]{.1 .1 1 .1}},hollow,opacity=0.6](0,6,0)
\psSolid[object=load,load=ConeB0,RotZ=90,grid,fillcolor={[rgb]{0 .5 0}},
    incolor={[cmyk]{.1 .1 1 .1}},hollow,opacity=0.6](0,6,0)
\psSolid[object=plan,action=draw,
    definition=equation,
    args={[1 0 0 0] 90},
    base=-3 3 -5 6.5,planmarks,showBase](0,0,0)
\axesIIID[linecolor=blue](0,0,0)(5.75,4,6)
\end{pspicture}
\end{center}
\end{document}

Herbert


More information about the PSTricks mailing list