%! % specify the width and height for good placement /w 200 def /h 200 def (ps3d.inc) run (epsetup.inc) run % faces[0] points towards positive z-axis /faces[ [ [[0 0 0] [1 0 0] [1 1 0] [0 1 0]] [ 0 0 1 0 ] [ 1 0 0 ]] [ [[0 0 0] [1 0 0] [1 1 0] [0 1 0]] [ 0 0 -1 0 ] [ 0 0 1 ] ] ] def [ 0 0 10 1 ] set-eye /dA 10 def { page-begin /E get-virtual-eye def 0 1 1 { /i exch def /f faces i get def /p f 0 get def /n f 1 get def /c f 2 get def % draw the face if the virtual eye is on the outside n E dot-product 0 ge { newpath p p length 1 sub get aload pop moveto3d p { aload pop lineto3d } forall closepath3d gsave c aload pop setrgbcolor fill grestore stroke } if } for [0 1 0] dA rotate3d page-end } loop