4

I want to present a cube to illustrate, and I want to color four of its sides. The colors will be blue, red, green and yellow; the two remaining sides should be clear or white or, perhaps, black. In part of this I want to show one color at a time, i.e. one side colored and the other sides clear or white or black. Thence I also want to show more sides colored, and if possible I also want to show overlap effects. How may I get this started?

7
  • pst-solides3d was developed to solve your problem. Just wait for a couple of hours as someone might be preparing the answer for you with it. May 3, 2014 at 5:37
  • Thank you for this encouraging comment which makes me hopeful. May 3, 2014 at 6:04
  • Have a look on this example at mirrors.ctan.org/info/examples/PSTricks_6_de/36-00-2.ltx -- it is from Herbert Voss' book 'PSTricks', there are also English versions of those examples/book but I did not figure out how example numbers changed.
    – user31729
    May 3, 2014 at 6:09
  • I get the error exaarticle.cls not found. May 3, 2014 at 6:58
  • @user24406: exaarticle can be replaced with standalone. May 3, 2014 at 7:09

1 Answer 1

3

Run with xelatex or latex->dvips->ps2pdf:

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}

\begin{document}

\psset{viewpoint=30 20 20 rtp2xyz,Decran=30}
\multido{\iA=-180+10}{50}{%
  \begin{pspicture}(-3.5,-3.5)(3.5,3.5)
    \psSolid[object=cube,a=4,
      fcol= 1 (red)
            2 (blue)
            3 (green)
            4 (yellow),
      RotX=\iA,RotY=\iA\space neg]%
  \end{pspicture}
}

\end{document}

enter image description here

4
  • Thank you, that is nice. The two blank sides should be adjacent according to my scheme, and the blue side shall oppose the red side. May 3, 2014 at 6:59
  • insert numfaces=all as optional argument for the cube, then you'll understand the numbering of the sides and you can change the color
    – user2478
    May 3, 2014 at 7:03
  • More importantly. (1) I want this in a beamer presentation; is the documentclass used here combinable with the beamer document class? (2) I am not so interested in the rotation, but want to see the cube from an angle from which the two white/transparent sides are visible and from which I see the blue side nearest me, the green side as bottom, the red side furthest and the yellow side to the right - as it were; as stated, one might have overlap effects if that is possible and helpful. May 3, 2014 at 7:28
  • The standalone is only for demonstration. Use beamer instead and run it with xelatex. The viewpoint is given as "radius Theta Phi" and rtp2xyz converts it to "x y z" values which are expected.
    – user2478
    May 3, 2014 at 7:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .