#include "colors.inc"

  global_settings {
    assumed_gamma 1.8
  }
  camera {
    location <0, .1, -75>
    look_at 0.1
    angle 30
  }

  background { color Gray50 } // to make the torus easy to see

  light_source { <300, 300, -1000> White }

  #declare full_tor = torus {
     4, 1              // major and minor radius
     rotate -90*x      // so we can see it from the top
     pigment { Green }
   }

  #declare half_tor = difference {
    torus {
      4, 1
      rotate x*-90  // so we can see it from the top
    }
    box { <-5, -5, -1>, <5, 0, 1> }
    pigment { Green }
  }
  #declare tor_trans = 8;  // twice the major radius

  #declare flip_it = 180*x;

  #declare snake = union {
    object { half_tor }
    object { half_tor
      rotate flip_it
      translate x*tor_trans
    }
    object { half_tor
      translate x*tor_trans*2
    }
    object { half_tor
      rotate flip_it
      translate x*tor_trans*3
    }
    object { half_tor
      rotate flip_it
      translate -x*tor_trans
    }
    object { half_tor
      translate -x*tor_trans*2
    }
    object { half_tor
      rotate flip_it
      translate -x*tor_trans*3
    }
    object { half_tor
      translate -x*tor_trans*4
    }
    rotate y*45
    translate z*20
  }


  object { snake }
  
