#include "colors.inc"
#include "textures.inc"
#include "stones.inc"
//#include "bdiff13.inc"
//#include "basicbody.inc"

//#declare CClock=3.2*clock+.1411111222
//#declare CClock=.50
//#declare clock=.3
//   y=1/(1-a)*x+a/(a-1)

#switch (clock)
    #range (-1,.08)
     #declare vvclock=0
    #break
    #range (.08,2)
    #declare  vvclock=1/(1-.08)*clock+.08/(.08-1)
      // This section is parsed if (VALUE>=LOW_2)&(VALUE<=HIGH_2)
    #break
    #else
      #declare vvclock=0
  #end

camera {
       location <0,3,2.5+23*pow(vvclock,.33)>
       look_at <0,3,0>
       rotate <0,178*pow(vvclock,.85),0>
       translate <0,0,-125*clock>
       angle 45+10*pow(vvclock,.45)
       }

//camera {location <0,60,-105>       look_at <-0,0,-105>       angle 75}

background { color rgb <.4,.5,.9>}
/*
plane {y,-9
      pigment {
    gradient z
    color_map {
      [0.0  color White]
      [0.85  color White]
      [0.85001  color Red]
      [1  color Red]
    }
    scale 9
  }
   rotate <0,90,0>
   translate <-4,0,0>
       }
*/

box {<-48,-9,-1000>,<48,-11,2000>
    pigment {
            gradient x
            color_map {
                      [0.0  color Gray30]
                      [0.45  color Gray30]
                      [0.4501  color White]
                      [0.550  color White]
                      [0.5501  color Gray30]
                      [1  color Gray30]
                      }
             scale 9
             }
    normal{
           gradient x
           slope_map {
                    [0.0   <0, 0>]
                    [0.45   <0, 0>]
                    [0.4501  <1, 1>]
                    [0.550  <1, 1>]
                    [0.5501  <0, 0>]
                    [1   <0, 0>]
                    }
          scale 9
          }

}
//plane { <0, 1, 0>, -9.5  normal {crackle      scale 10 }          pigment {Tan }}
plane {<0,1,0>,-13 normal {ripples} pigment { rgbt <.1,.2,.8,.3>} finish {reflection .3 }}

box {<-45,-5,-1000>,<-48,-3,2000> pigment {Gray50}}
box {<45,-5,-1000>,<48,-3,2000> pigment {Gray50}}


height_field {
    tga "E:\TEMP\hf-lab090\hf-lab90\dang2.tga"
    //[ water_level FLOAT ]
    rotate <0,-7,0>
    scale <1,.35,1>
    translate <-.47,-.2,-.65>
    scale 6500
    texture {
  pigment {
    granite
    turbulence 0.7
    color_map {
      [0.00 0.07 color rgb <0.7743, 0.3353, 0.5701*.7>
                 color rgb <0.5210, 0.1044, 0.0333>*.7]
      [0.07 0.13 color rgb <0.5210, 0.1044, 0.0333*.7>
                 color rgb <0.3663, 0.5682, 0.0687>*.7]
      [0.13 0.31 color rgb <0.3663, 0.5682, 0.0687*.7>
                 color rgb <0.0887, 0.9886, 0.4438>*.7]
      [0.31 0.39 color rgb <0.0887, 0.9886, 0.4438*.7>
                 color rgb <0.1308, 0.9083, 0.5524>*.7]
      [0.39 0.55 color rgb <0.1308, 0.9083, 0.5524>*.7
                 color rgb <0.4840, 0.3945, 0.7343>*.7]
      [0.55 1.00 color rgb <0.4840, 0.3945, 0.7343>*.7
                 color rgb <0.1755, 0.5095, 0.4480>*.7]
    }
  }
  finish {reflection 0}
  scale <0.98 0.87 0.81>
}  }

light_source {<300, 5500, -5510.8056> color White*.8269}
light_source {<00, 5510., -5200> color White*.82699}
light_source {<-200, 5440., -5000> color White*.8269}
light_source {<-20, 4., -450> color White*.13}

#declare nstep=-21
#while (nstep<21)

superellipsoid {
    <0.1, 1>
    scale <1,8,1>
    pigment { Gray50 }
    translate <-46,-5, nstep*18>
  }
superellipsoid {
    <0.1, 1>
    scale <1,8,1>
    pigment { Gray50 }
    translate <46,-5, nstep*18>
  }
#declare nstep=nstep+1
#end

/*
box{<40,-5,-0>,<-40,5,.1>
      texture{
              pigment{
                      image_map {
                                tga "finish.tga"
                                once
                                map_type 0
                                }

                     }
             finish {ambient rgb <.43,.43,.43> }
            }
            //rotate <0,180,0>
            scale <-50,15,15>
            translate <25,13,-125>
              }
*/

intersection {
box{<40,-5,-0>,<-40,5,.1>
     pigment {rgbt <.8,.3,.3,.25>}
     finish {ambient rgb <1,1,1>}
                 scale <-40,15,15>
            translate <25,13,-125>
    }
text { ttf "futuraxk.ttf" "FINIS" .21, 0
                        scale 26
                        rotate <0,180,0>
                        translate <35,20,-125>
                        texture { pigment {rgbt <.8,.3,.3,.40>}
                        finish {ambient rgb <1,1,1>}
                                  //finish {reflection 0.2}
                                }}}

difference{
box{<40,-5,-0>,<-40,24,.11>
     pigment {rgbt <.87,.99,.99,.85>}
             finish {ambient rgb <1,1,1>}
                // scale <1,1,1>
            //translate <25,13,-125>
            translate <0,19,-125>
    }

text { ttf "futuraxk.ttf" "FINIS" 12.1, 0
                        scale <26,26,75>
                        rotate <0,180,0>
                        translate <35,20,-120>
                        texture { pigment {rgbt <.8,.3,.3,.85>}
                        finish {ambient rgb <1,1,1>}
                                  //finish {reflection 0.2}
                                }}
}



/*
text { ttf "futuraxk.ttf" "BEGIN" .2, 0
                        scale 30
                        rotate <0,180,0>
                        translate <40,24,200>
                        texture { pigment {Red}
                                  finish {reflection 0.2}
                                }
                        }

*/

//#declare cyllie=-8
//#declare czllie=-.4
//cylinder {<-200,cyllie,czllie>,<200,cyllie,czllie>,.5         pigment {Green}}



object {
      #include "bdiff13.inc"
       //rotate <-5       ,0,0>
       //translate <0,0,0-25*CClock>
       texture {T_Chrome_2C}
       }

object {
       #declare CClock=5.3*clock
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <-9,0,20-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }

object {
       #declare CClock=5.05*clock*(1-.3*pow(clock,.5))-.222222
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <0,0,20-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }

object {
       #declare CClock=5.15*clock+.0753
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <9,0,20-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }
object {
       #declare CClock=5.146*clock-.125555553
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <24,0,40-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }
object {
       #declare CClock=4.92225*clock-.153
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <8,0,40-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }
object {
       #declare CClock=5.15*clock-.153
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <-8,0,40-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }
object {
       #declare CClock=4.8845*clock+.05
       #include "basicbody.inc"
       rotate <-5       ,0,0>
       translate <-24,0,40-25*CClock>
       texture {Yellow_Pine
               scale 3}
       }
