#include "colors.inc"
#include "textures.inc"

background{ LightSteelBlue }

#declare ctr = <  0.00, 0.80, 0.00 >;
#declare vis = <  7.00, 0.00, 15.00 >;
#declare cam = vis + 7*y;
// #declare cam = 0.01*vis + 20*y;

light_source {
  ctr + 50*(vrotate(vis, 90*y) + 10*y)
  color rgb < 0.90, 0.90, 0.90 >
} 

light_source {
  ctr + 50*(vrotate(vis, -20*y) + 8*y)
  color rgb < 1.00, 1.00, 1.00 >
} 


// general light definition
light_source {
  <12, 34, -15>      // position of the light source
 color green 1
}

// general light definition
light_source {
  <6.6, 40, 10>      // position of the light source
  color red 1
}

camera {
  location  < 3.5 ,14.0, -50.0 >
  right     < +0.60, 0.00, 0.00 >
  up        <  0.00, 0.00, 0.80 >
  sky       <  0.00, 1.00, 0.00 >
  look_at   < 6.5, 12.0 , 0.0 >
} 

#declare transparente =
  texture {
    finish {
      ambient 0.1 diffuse 0.1
      reflection 0.25
      specular 1 roughness 0.001
    }
    pigment { color Yellow  filter 1}
  }

#declare cor_espelho = < 0.8, 1.0, 0.8 >;
#declare tx_espelho =
  texture{
    pigment{ rgb cor_espelho }
    finish{
      ambient 0.05 diffuse 0.05
      reflection cor_espelho
      specular 0.02 roughness 0.05
    }
  }


#declare telhado =
  cone {
    <6.50, 30, 10>, 0.0,
    <6.5, 20, 10>, 9.0 
//    scale <1.5, 1.5, 1.2>
    texture {tx_espelho} // texture {Gold_Metal}
  }
  
  

#declare coluna = 
  cylinder {
    < 0.00, 0.0, 0.0 >,
  < 0.00, 20.0, 0.0 >, 1.0
    texture {Silver_Metal}
    //  texture { transparente } 
    
    translate <0.0, 0.0, 0>
    }

#declare base = 
  // create a box that extends between the 2 specified points
box {
  <1, 0, 0>  // one corner position <X1 Y1 Z1>
  < 12,  20,  20>  // other corner position <X2 Y2 Z2>
  texture { transparente } 
  interior {ior 5.6}
}

#declare basedentro = 
  // create a box that extends between the 2 specified points
box {
  <3, 0, 3>  // one corner position <X1 Y1 Z1>
  < 11,  20,  18>  // other corner position <X2 Y2 Z2>
  
texture { Silver_Metal }
}


#declare coroa =
  torus {
    2.0, 1.2 
    scale < 1.50, 1.00, -1.50>           
    texture { Copper_Metal }
}


#declare plano =
  plane {
  y, -4.0
    pigment { checker color Black color White }
    texture { White_Marble }
}



// Aqui está a cena, finalmente:

union { 
  object { base } 
  object { basedentro } 
  union
  { 
    // frente
    object { coluna translate < 0.5,0.0 ,2.5 >}
    object { coluna translate < 4.5,0.0 ,0.5 >}
    object { coluna translate < 8.5,0.0 ,0.5 >}
    object { coluna translate < 12.5,0.0 ,2.5 >}
    // fundo 
    object { coluna translate < 0.5, 0.0 ,19.5 >}
    object { coluna translate < 4.5, 0.0 ,17.5 >}
    object { coluna translate < 8.5, 0.0 ,17.5 >}
    object { coluna translate < 12.5,0.0 ,19.5 >}
  }
  object { telhado }
  object { plano rotate x*-20}
  object { coroa translate < 5,0 ,-13> }
}