#include "colors.inc"    // The include files contain
#include "stones.inc"    // pre-defined scene elements
#include "textures.inc"
#include "sunpos.inc"

#include "colors.inc"
    camera {
    location <3.5, 5, -14>
    look_at  <1.4,4,-5>
  }
  
  light_source { <2, 4, -3> color White}
  light_source { <-2, 4, -3> color White}
  light_source { <0, 1, -3> color White}  
  light_source { <0, 3, 3> color White}
  light_source { <-5, 3, 23> color White}
  light_source { <15, 3, 13> color White}
 // light_source { <6, 5, -14> color White}
 
  
union{
cone {
    <0, 0, 0>, .6    // Center and radius of one end
    <0, 5, 0>, .12    // Center and radius of other end
    open
    texture {T_Stone22 scale 2}

 }



difference{
  cone {
    <0, 5, 0>, .12    // Center and radius of one end
    <0, 6, 0>, .6    // Center and radius of other end
    open
    texture { T_Stone22 scale 2 }
  }
  box {
    <-1, 1,   -1>,  // Near lower left corner
    < 1, -1,  1>   // Far upper right corner

                rotate 45*z
                translate <-0.40, 6.6, 0.3>
                //pigment {color Green}
  }
 }
translate <5,0,3>
}

 merge{
 
 box {
    <-1, 0.1,   -1>,  // Near lower left corner
    < 5, -1,  5>   // Far upper right corner

                translate <-5.65, 1, 0.3>
                texture { T_Stone13 scale 2 }
                
  }
 
 }
 
 //Holder


difference{

 torus {
    6.5, .4              // major and minor radius
    rotate -90*x      // so we can see it from the top
    translate <0.5, 1, 1.6>
    texture { T_Stone13 scale 4 }
  }
  
 box {
    <-3, 0.1,   2>,  // Near lower left corner
    < 10, 9,  4>   // Far upper right corner

                translate <1.3, 0,-0.9>
                
  }
}


//end Holder

sphere{ 

      0,1
      texture{T_Stone11 scale 2}
      translate <-1.8,2.4,1.6>
}

//Cahin

#declare Chain_Gray = texture {
    pigment { Gray }
    finish {
      ambient .1
      diffuse .4
      reflection .25
      specular 1
      metallic
    }
  }

#declare Half_Torus = difference {
    torus {
      2,1
      sturm
      rotate x*-90  // so we can see it from the top
    }
    box { <-5, -5, -1>, <5, 0, 1> }
  }
  
  #declare Flip_It_Over = x*180;
  #declare Torus_Translate = 8;

  #declare Chain_Segment = cylinder {
  
    <0, 4, 0>, <0, -4, 0>, .7
  }
  
#declare Link = union {
    object {
      Half_Torus
      translate y*Torus_Translate/2.6
    }
    object {
      Half_Torus
      rotate Flip_It_Over
      translate -y*Torus_Translate/2.6
    }
    object {
      Chain_Segment
      translate x*Torus_Translate/2.6
    }
    object {
      Chain_Segment
      translate -x*Torus_Translate/2.6
    }
    texture { Chain_Gray }
  }

#declare Link_Translate = Torus_Translate*2-8*y;
#declare Link_Pair =

  union {
    object { Link }
    object { Link translate y*Link_Translate rotate y*90 }
  }

#declare Chain = union {
    object { Link_Pair}
    object { Link_Pair translate  y*Link_Translate*2 }
    object { Link_Pair translate  y*Link_Translate*4 }
    object { Link_Pair translate  y*Link_Translate*6 }
    object { Link_Pair translate -y*Link_Translate*2 }
 //   object { Link_Pair translate -y*Link_Translate*4 }
 //   object { Link_Pair translate -y*Link_Translate*6 }
  }

object { 

Chain scale .05 rotate <0, 45, 2>
translate <-1.8,4,1.6>

}

// end Chain

 

 
 
 //Plane
      
 plane{<0,1,0>, 0
        texture {
        pigment {
        dents
        triangle_wave
        color_map {
          [0.0 rgb <0.0, 0.4, 0.1>]
          [1.0 rgb <0.1, 0.6, 0.2>]
      }
      }
      }
   }

//Sky and clouds


plane{<0,1,0>,10000 hollow  // 
      
      texture{ pigment {color rgb<0.2,0.5,0.8>}
               finish {ambient 1  diffuse 0}}
     }
plane{<0,1,0>,1 hollow  // 
      texture{pigment { bozo turbulence 0.65
                        octaves 6  omega 0.7 lambda 2 
                        color_map { [0.0 color rgb <0.95, 0.95, 0.95>]
                                    [0.1 color rgb <0.85, 0.85, 0.85>]
                                    [0.5 color rgbt <1, 1, 1, 1> ]
                                    [1.0 color rgbt <1, 1, 1, 1> ]   }
                        rotate<10,20,0>
                        scale <0.3, 0.4, 0.2>*3 }
              finish {ambient 1 diffuse 0}}
      scale 2000}  
// fog at the horizon     
fog{distance 310000 color White}