// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.5
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.5;

#include "colors.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "glass.inc"
#include "textures.inc"
#include "mrg_misc.inc"
#include "screen.inc"

// a lot of stone textures
// T_Stone1 - T_Stone44
#include "stones.inc"

  //Tetrahedron         // CSG-able tetrahedron shape
  //Octahedron        // CSG-able octahedron shape
  //Dodecahedron      // CSG-able dodecahedron shape
  //Icosahedron       // CSG-able icosahedron shape
  //Hexagon           // Hexagon extending along x-axis
  //Rhomboid          // 4-Sided Diamond
  //Pyramid           // non-CSG four-sided pyramid
  //Pyramid2          // CSG-able four-sided pyramid
  //Square_X          // square from <-1, -1> to <1, 1> in y-z-plane
  //Square_Y          // square from <-1, -1> to <1, 1> in x-z-plane
  //Square_Z          // square from <-1, -1> to <1, 1> in x-y-plane

global_settings {
  assumed_gamma 1.0
  ambient_light .2
}

// ----------------------------------------
#declare lclock=clock+.0;
//step back, then step/zoom in
//#declare lscale = .2+.8*lclock;
#declare lscale = .1+.9*(transitor(lclock,.1,.3)-transitor(lclock,.5,.4));


#declare cscale = .1+.9*(1-transitor(lclock,.5,.4));
camera {
  location  <0.0, 1.5, -20.0*lscale>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0, 1,  0.0>
  angle 10/cscale
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}
// An area light (creates soft shadows)
// WARNING: This special light can significantly slow down rendering times!
light_source {
  0*x                 // light's position (translated below)
  color rgb 1.0       // light's color
  area_light
  <0, 0, 0> <0, 4, 4> // lights spread out across this distance (x * z)
  4, 4                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  circular            // make the shape of the light circular
  //orient              // orient light
  translate <-40, 20, -10>   // <x y z> position of light
}


//build and arch ala    http://www.f-lohmueller.de/pov_tut/xsamples/povarc4e.htm
#declare pillar=union{
cone{y,.12,0,.14}
torus { .12, 0.05 translate y*(1-.05)}
torus { .14, 0.05 }

}

#declare arch_top=difference{
        box{<-1.1,0,-.1>,<1.1,1.1,.1>}
        cylinder{-.2*z,.2*z,.9}
        translate y*1
}

union{

        object{arch_top translate z*1}
        object{arch_top translate z*1 rotate y*90}
        object{arch_top translate z*1 rotate -y*90}
        object{arch_top translate z*1 rotate y*180}
        object{pillar translate x+z}
        object{pillar translate x-z}
        object{pillar translate -x+z}
        object{pillar translate -x-z}

        texture{T_Grnt9
                        finish {
                        ambient 0.3          // ambient surface reflection color [0.1]
                        diffuse 0.6          // amount [0.6]
                        brilliance .8       // tightness of diffuse illumination [1.0]
                        phong 1.8          // amount [0.0]
                        phong_size 240      // (1.0..250+) (dull->highly polished) [40]
                        
                        //reflection {.05}
                } // finish

        
        scale .2}
        translate .3*y

}

union{
     box{1.25*(x+z), -1.25*(x+z)+.1*y translate .2*y}
     box{1.45*(x+z), -1.45*(x+z)+.1*y translate .1*y}
     box{1.65*(x+z), -1.65*(x+z)+.1*y }
              pigment{color Gray}
     texture{
        pigment{
        granite        // create a granite-like texture
            color_map {      // color map
              [0.1 color rgb <.19,.2,.19>]
              [0.5 color rgb <.4,.2,.4>]
              [0.75 color rgb <.1,.05,.1>]
              [0.9 color rgb <.37,.4,.37>]
            }
            turbulence 1.5   // some turbulence
            scale <1,1,1>/3    // transformations
  
        }
                        finish {
                        ambient 0.1          // ambient surface reflection color [0.1]
                        diffuse 0.6          // amount [0.6]
                        brilliance .8       // tightness of diffuse illumination [1.0]
                        phong 0.5          // amount [0.0]
                        phong_size 140      // (1.0..250+) (dull->highly polished) [40]
                        
                        reflection {.1}
                } // finish


     }
      }
      
      
box{.8*(x+z), -.8*(x+z)+.105*y translate .2*y
        texture {
                pigment {          // (---surface color---)
                checker
                color rgb <1, 1, 1>,
                color rgb <0, 0, 1>
                scale <1,1,1>/5    // transformations
                }
                        // control an object's surface finish
                finish {
                        ambient 0.1          // ambient surface reflection color [0.1]
                        diffuse 0.6          // amount [0.6]
                        brilliance .8       // tightness of diffuse illumination [1.0]
                        phong 0.5          // amount [0.0]
                        phong_size 140      // (1.0..250+) (dull->highly polished) [40]
                        
                        reflection {.7}
                } // finish


        }
}


#declare cht=.7;
#declare crad=.1;
#declare cyl=  cylinder{0,cht*y,crad};
#declare vcut = .8*cht;
#declare ncut = 20;
#declare rcut = 2*pi*crad/ncut*.3;
#declare cutter_top =(cht+vcut)/2;
#declare cutter_bot =(cht-vcut)/2;
#declare cutter_1=union{
        cylinder{ cutter_top*y,cutter_bot*y,rcut}
        sphere{cutter_bot*y,rcut}
        sphere{cutter_top*y,rcut}
}
#declare cutter=union{
        #declare i=0;
        #while(i<ncut)
                #object{cutter_1 translate x*crad rotate y*i/ncut*360}
                #declare i=i+1;
        #end
}        

union{
        difference{
                object{cyl}
                object{cutter} 
                 }
        torus{crad,crad*.3 translate (cht-crad*.3)*y}
        torus{crad,crad*.3 translate crad*.4*y}
        torus{crad*1.3,crad*.3 }
         texture{T_Stone8
                        finish {
                        ambient 0.75          // ambient surface reflection color [0.1]
                        diffuse 0.6          // amount [0.6]
                        brilliance .8       // tightness of diffuse illumination [1.0]
                        phong 1.8          // amount [0.0]
                        phong_size 240      // (1.0..250+) (dull->highly polished) [40]
                        
                        //reflection {.05}
                } // finish

        
        scale .1}
        translate .3*y
}        
/**/
object{Dodecahedron scale .25 translate 1.22*y
        texture {Brass_Metal}
 }        






// ----------------------------------------
   
plane {
  y, 0  
  
texture {
          pigment {          // (---surface color---)
            wrinkles          // some pattern
            color_map {      // color map
              [0.1 color rgb <.19,.6,.19>]
              [0.5 color rgb <.0,.2,.0>]
              [0.75 color rgb <.1,.7,.1>]
              [0.9 color rgb <.37,.8,.37>]
            }
            turbulence 2.5   // some turbulence
            scale <1,1,1>    // transformations
          }
          normal {           // (---surface bumpiness---)
            wrinkles 0.1       // some pattern (and intensity)
            turbulence 2.5   // some turbulence
            translate x*10    
            scale <1,1,1>    // transformations
            rotate y*90
          }
          finish {           // (---surface finish---)
            ambient 0.2
            specular 0.2     // shiny
          }
          scale .02
}
}
/*pigment{color Green}

//add inset
Set_Camera_Location(-5*z)
Set_Camera_Look_At(0)
Set_Camera_Angle(15)
Screen_Object (
        object{
                box{0, <.1,.1,-.001> pigment{ color rgbt <.9,.3,.3,.0>}}
        }, 
        
        <.75,.25>,   //<u,v> screen location
         .0,      //spacing
          true ,  //confine ?
          .001      //scaling
          )
*/