1

Another question aboutpst-solides3d and visibility:

How can one draw a legend on top of the 3d drawings ?

I thought that putting the put command before or after the 3d drawings commands would render the text in the foreground, but with both ways, the text is hidden:

\documentclass[10pt]{article}

\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{pst-solides3d}


\begin{document}

\begin{figure}[h!]
\centering
\begin{pspicture}(0,-3)(7,3)

\psset{viewpoint=60 30 30 rtp2xyz,Decran=60,lightsrc=viewpoint, solidmemory}

\Large
\rput(0.5,2.7){$x^2$}
\normalsize

\psSolid[object=cylindre, h=0.4,r=2.7, fillcolor=white, ngrid=1 32, RotY=0, RotX=0] (0,0,1.1445)

\Large
\rput(0,2.7){$x^2$}
\normalsize

\end{pspicture}
\end{figure}

\end{document}

Compilation: latex bug.tex; dvips bug.dvi; ps2pdf bug.ps

2

The easy way out is to include pst-3dplot package and then use \pstThreeDPut command.

\documentclass[10pt]{article}

\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{pst-solides3d}
\usepackage{pst-3dplot}

\begin{document}

\begin{figure}[h!]
\centering
\begin{pspicture}(0,-3)(7,3)

\psset{viewpoint=60 30 30 rtp2xyz,Decran=60,lightsrc=viewpoint, solidmemory}

\psSolid[object=cylindre, h=0.4,r=2.7, fillcolor=white, ngrid=1 32, RotY=0, RotX=0]     (0,0,1.1445)

\Large
\pstThreeDPut(0,2.7,2.5){$x^2$}

\end{pspicture}
\end{figure}

\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.