1

PSTricks can project .eps images onto 2D planes in 3D. Here's an example from the documentation.

enter image description here

I would like to perform a similar projection with a bitmap image (.png or .jpg). I've tried converted the bitmap to .eps using ImageMagick, but PSTricks doesn't work with the .eps output from ImageMagick.

Has anyone displayed a bitmap in PSTricks?

Parallel question here: Can Asymptote project 2D images in 3D?

4

Yes, this works. Here is an example. Of course you need to come up with your eps files. I created those used in the example below with ImageMagick.

enter image description here

 \documentclass{standalone}
 \usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}
 \usepackage[ngerman]{babel}
 \usepackage{pst-all}
 \usepackage{pst-3dplot,pst-blur}
 \usepackage{graphicx} % including PostScript
 \newcommand{\CenterObject}[1]{\ensuremath{\vcenter{\hbox{#1}}}}

 \begin{document}

  \newgray{gray75}{0.75}\newgray{gray85}{0.85}\newgray{gray95}{0.95}
  \begin{pspicture}(-5.5,-2.5)(5,3.5)
   \psset{viewpoint=1 1.5 0.5}
   \ThreeDput(0,0,0){$\CenterObject{\includegraphics[scale=0.6]{Galaxie.eps}}$}
   \psset{viewpoint=-1 -1.5 0.5}
   \ThreeDput(-4.5,-4.5,0){\Huge \white 4D space--time}
   \psset{viewpoint=1 1.5 0.5}
    \ThreeDput(2,2,0){\psellipse*[linecolor=gray75](0.02,0.01)}
      \pspolygon[fillcolor=gray75,fillstyle=solid,linecolor=gray75](-0.58,-0.75)(-3.48,1.5)(2.39,1.52)(-0.58,-0.75)
   \ThreeDput(2,2,2.5){\psellipse[fillcolor=white,linecolor=gray75,fillstyle=solid](3,3)}
   \ThreeDput[normal=0 1 0](2,2,2.75){\includegraphics[scale=0.2]{calabi-yau-space-small.eps}}
    \rput[c](-4,2.6){\ovalnode[shadow=true,blur=true]{cal}{\begin{tabular}{c}
    compact\\ space
    \end{tabular}}}
    \pnode(-1,2.3){cal1}
    \ncarc{->}{cal}{cal1}
  \end{pspicture}

  \end{document}
| improve this answer | |
  • Hmm I tried your snippet with my .eps files (and .png files) and I got a garbled image. How did you create the .eps file? Just convert input.png output.eps? – Talon Chandler Feb 3 '17 at 0:30
  • @Talon Chandler: Yes, I used convert. Did you ever view your eps file without including it in a PSTricks picture? (Notice also that I do not use pdflatex, rather I compile to ps and then convert the ps to eps and then to pdf.) – user121799 Feb 3 '17 at 0:55
  • Excellent that works perfectly. As you guessed, I had an issue in my conversion chain. – Talon Chandler Feb 3 '17 at 1:53

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.