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?
Asked
Active
Viewed 523 times
4
1 Answers
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}

-
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. – Frode Alfson Bjørdal May 03 '14 at 06:59
-
insert
numfaces=allas optional argument for the cube, then you'll understand the numbering of the sides and you can change the color – May 03 '14 at 07: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. – Frode Alfson Bjørdal May 03 '14 at 07:28
-
The
standaloneis only for demonstration. Usebeamerinstead and run it withxelatex. Theviewpointis given as "radius Theta Phi" andrtp2xyzconverts it to "x y z" values which are expected. – May 03 '14 at 07:48
pst-solides3dwas developed to solve your problem. Just wait for a couple of hours as someone might be preparing the answer for you with it. – kiss my armpit May 03 '14 at 05:37exaarticlecan be replaced withstandalone. – kiss my armpit May 03 '14 at 07:09