\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
\pstVerb{/Colors [(red)(yellow)(orange)(green)(blue)] def }
\def\figure#1#2{%
\begin{pspicture}(-3,-3)(3,3)
\psframe[linestyle=none,fillstyle=solid,fillcolor=blue!50](-3,-3)(3,3)
\psSolid[action=draw**,a=8,object=cube,fillcolor=green!30,ngrid=3,%
rm=4 40 13 31 53 22,hollow,incolor=pink!50,Rot#2=-#1\space]%
\end{pspicture}
}
\multido{\iA=0+5}{72}{\figure{\iA}{X}}
\end{document}
It is hollowed inside the cube.
So, how to get the similar output to the following image?
%% From Herbert's comment
\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\begin{pspicture}(-4.5,-3.5)(6,6)
\psset{Decran=60,viewpoint=80 35 15 rtp2xyz,a=1,lightsrc=80 30 20,}
% \psSolid[object=grille,base=0 7 0 7,fillcolor=gray!40]%%
% \psSolid[object=grille,base=0 7 0 7,RotY=90,fillcolor=gray!30](0,0,7)%
% \psSolid[object=grille,base=0 7 0 7,RotX=-90,fillcolor=gray!20](0,0,7)%
\def\figure#1#2#3{\psSolid[object=cube,fcol=1 (green) 2 (blue) 3 (red) 4 (pink) 5 (orange) 6 (cyan)](#1,#2,#3)}
\foreach \i in {0.5,1.5,2.5}{\figure{0.5}{\i}{0.5}}
\foreach \i in {1.5,2.5}{\figure{\i}{.5}{0.5}}
\figure{1.5}{2.5}{0.5}
\foreach \i in {1.5,2.5}{\figure{2.5}{\i}{0.5}}
\foreach \i in {1.5,2.5}{\figure{.5}{.5}{\i}}
\figure{2.5}{.5}{1.5}
\figure{.5}{1.5}{2.5}
\foreach \i in {1.5,2.5}{\figure{\i}{.5}{2.5}}
\figure{2.5}{1.5}{2.5}
\foreach \i in {1.5,2.5}{\figure{.5}{2.5}{\i}}
\figure{1.5}{2.5}{2.5}
\foreach \i in {1.5,2.5}{\figure{2.5}{2.5}{\i}}
\end{pspicture}
\end{document}
But with viewpoint=80 135 15 rtp2xyz , I get the following:
asymptote
you might be interested in tex.stackexchange.com/a/447120/121799 if you insist on the perspective view. If not, please add the information that you are not to your question. (+1)\psSolid[object=cube,..](x,y,z)
. That's allsolidmemory, action=none,name=cubeXXX
and then an objectfusion
. See documentation for a lot of examples. Without theobject=fusion
you cannot have hidden surfaces.