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?
1 Answer
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}
-
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– user2478May 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. Usebeamer
instead and run it withxelatex
. Theviewpoint
is given as "radius Theta Phi" andrtp2xyz
converts it to "x y z" values which are expected.– user2478May 3, 2014 at 7:48
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.exaarticle
can be replaced withstandalone
.