Mardi 10 Juin 2008
Retour, répertoire : /pst-solides3d/tutoriel/octahedron
cube-octahedron.pst
\documentclass{article}
\usepackage{pst-solides3d}
\makeatletter
\def\lightsource{
\pstVerb{\pst@solides@viewpoint
/PhI exch def /ThetA exch def /Dist exch def
/Lx Dist ThetA cos mul PhI cos mul def
/Ly Dist ThetA sin mul PhI cos mul def
/Lz Dist PhI sin mul def}%
\psset{lightsrc=Lx Ly Lz}
}
\makeatother
\begin{document}
\pagestyle {empty}
\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psset{viewpoint=100 30 20,Decran=100}
\pstVerb{/radius 4 def
/edge_cube radius 4 mul 3 div def
/axes edge_cube 2 div def}%
\lightsource
\psSolid[object=octahedron,
a=radius ,
trunc=all,
hue=.5 .6,
trunccoeff=.3333,
action=draw*]
\psSolid[object=octahedron,
a=radius,linecolor=gray,
action=draw]
\psSolid[object=cube,linecolor=red,
a=edge_cube,
action=draw]
\axesIIID(axes,axes,axes)(5,5,5)
\end{pspicture}
\end{center}
\end{document}
Modifié le 10 Juin 2008 à 22 h 22.


