%!PS-Adobe-2.0 %%BoundingBox: 0 0 80 80 /w 80 def /h 80 def (ps3d.inc) run (cube.inc) run (epsetup.inc) run % ------------------------------------------------ [0 0 3 1] set-eye 0 0 -2 translate3d page-begin gsave3d [1 1 1] A rotate3d -0.5 -0.5 -0.5 translate3d /E get-virtual-eye def /L get-virtual-light def % L = light in current coordinates cube { % [ [P[0] P[1] ... P[n-1]] n ] dup 1 get /n exch def 0 get /f exch def % n = normal function /ell f length def n E dot-product 0 ge { newpath f ell 1 sub get aload pop moveto3d f { aload pop lineto3d } forall gsave n L dot-product [0.30 0.30 0.80 1] shade 0 0 setrgbcolor fill grestore stroke } if } forall grestore3d page-end