// Drops from space
// (C) 1/1996 Christian Perle

#include "colors.inc"

camera {
  location <-1, -.5, -2>
  direction .9*z
  look_at <.1, .1, 0>
}

light_source { <80, 100, -100> color rgb<1, 1, .8> }
light_source { <-50, 100, -90> color White }

sphere {
  <0, 0, 0>, 1
  pigment {
    bozo turbulence .6
    scale <1/2, 1/6, 1/2>
    color_map {
      [0 color rgb<.3, 0, 0>]
      [0.5 color Orange]
      [1 color Khaki]
    }
  }
  finish { ambient 1 diffuse 0 }
  scale <2000, 200, 2000>
}

#declare Drop = union {
  difference {
    sphere {
      <0, 0, 0>, 1
      pigment { Gray50 }
      finish { phong .7 phong_size 20 reflection .9 }
    }
    cone {
      <0, 0, 0>, 0, <0, 0, -1>, 1
      pigment {
        wood scale 2
        color_map {
          [0 color Red]
          [1 color Yellow]
        }
      }
      finish { phong .7 phong_size 20 }
    }
  }
  torus {
    1.2, .2
    pigment { SteelBlue }
    finish { phong .7 phong_size 20 }
  }
  bounded_by { sphere { <0, 0, 0>, 1.401 } }
  scale <1, 1/2, 1>
}

#declare Lightning = union {
  triangle { <-.4, 0, 0>, <.4, 0, 0>, <.4, 1, 0> }
  triangle { <-.4, 0, 0>, <.4, 1, 0>, <-.4, 1, 0> }
}

#declare LTex = texture {
  pigment {
    marble turbulence .3
    color_map {
      [0 color White]
      [0.1 color Blue]
      [0.2 color Clear]
      [1 color Clear]
    }
    translate .3*x
  }
  finish { ambient 1 }
}

object { Drop translate <-2, .5, 2> }
object { Drop translate <3, .5, 0> }
object { Drop translate <1, .5, 3> }
object { Drop translate <6, .5, 2> }
object { Drop translate <-1, .5, 6> }
object { Drop translate <3, .5, 6> }
object { Drop translate <7, .5, 7> }

object { Lightning translate <-2, -1, 2> texture { LTex translate 421*y } }
object { Lightning translate <3, -1, 0> texture { LTex translate 101*y } }
object { Lightning translate <1, -1, 3> texture { LTex translate -764*y } }
object { Lightning translate <6, -1, 2> texture { LTex translate 501*y } }
object { Lightning translate <-1, -1, 6> texture { LTex translate 834*y } }
object { Lightning translate <3, -1, 6> texture { LTex translate 234*y } }
object { Lightning translate <7, -1, 7> texture { LTex translate -365*y } }

plane {
  y, -1
  pigment {
    bozo
    color_map {
      [0 color Gray10]
      [1 color Red]
    }
  }
  finish { ambient .5 diffuse 0 }
}