%!PS-Adobe-2.0 %%BoundingBox: 0 0 144 144 72 dup translate (../../ps/ps3d.inc) run (sphere.inc) run % -------------------------------- /sc 64 def sc dup scale 1 sc div setlinewidth [0 0 4 1] set-eye [1 0 0 ] 130 rotate3d /S 18 sphere def /E get-eye cim3d transform3d def /light-source [-0.25 1 0.5 0] normalized def /L light-source cim3d transform3d def currentlinewidth 4 div setlinewidth S { aload pop /f exch def % f = normal function /p exch def % p = array of vertices on the face f E dot-product 0 ge { newpath % move to last point first p p length 1 sub get aload pop moveto3d p { aload pop lineto3d } forall gsave L f dot-product [ 0.2 0.2 0.9 0.9 ] shade setgray fill grestore stroke } if } forall