Problem 4b.

//contrast between shape and texture
//a textured sphere
command sphere h k r
{
   repeat x 0 100
   {
      repeat y 0 100
      {
         set [x y] (((x-h)*(x-h))/r+((y-k)*(y-k))/r)
      }
   }
}
sphere 70 70 8
command box a b
//a hollow box
{
antialias 1
   pen 0
   repeat c 0 20

   {
      line a b a (b+20)
      line a (b+20) (a+20) (b+20)
      line (a+20) (b+20) (a+20) b
      line (a+20) b a b
      line (a+38) (b+32) (a+18) (b+32)
      line (a+18) (b+32) (a+18) (b+12)
      line (a+18) (b+12) (a+38) (b+12)
      line (a+38) (b+12) (a+38) (b+32)
      line (a+38) (b+32) (a+20) (b+20)
      line (a+38) (b+12) (a+20) b
      line (a+18) (b+32) a (b+20)
      line (a+18) (b+12) a b
   }
}
box 10 10







-gary escudero