// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited on 2003-09-04 15:25:26 by stolfi

// ======================================================================
// CÂMERA 

 
#include "textures.inc"



camera {
  location  1.5*<  5.00, 5.00, 2 >  // Posição do observador.
  right     -1*x                // Largura RELATIVA da imagem.
  up        .75*y                 // Altura RELATIVA da imagem.      
  sky       z                      // Qual direção é "para cima"?
  look_at   <  0.00, 0.00, 0 >  // Para onde a câmera está apontando.
} 
// Nota: os parâmetros "right" e "up" devem ter a mesma proporção
// que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile.

// ======================================================================
// FONTES DE LUZ

light_source {
  10 * < +50.0, +30.0, +50.0 >              // Posição da lâmpada.
  color rgb 1.2 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
} 

light_source {
  10 * < +50.0, -10.0, +10.0 >             // Posição da lâmpada.
  color rgb 0.8 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
} 

// ======================================================================
// DESCRIÇÃO DA CENA 

background{ color rgb < 0.75, 0.80, 0.85 > }

#declare raio = 2.000;

#declare cor_espelho = <.7,.3,.6>;
#declare tx_espelho =
  texture{
    pigment{rgb cor_espelho}
    finish{
      ambient 0.05 diffuse 0.05
      reflection cor_espelho
      specular 0.2 roughness 0.05
 }
}
#declare cor_espelho2 = <1,.8,.1>;
#declare tx_espelho2 =
  texture{
    pigment{rgb cor_espelho2}
    finish{
      ambient 0.05 diffuse 0.05
      reflection cor_espelho2
      specular 0.2 roughness 0.05
 }
}


#declare cor_cristal = < 0.1,0.5,0.1>;
#declare tx_cristal =
   texture {
     finish{
      ambient 0.1 diffuse 0.1 reflection 0.25
      specular 1 roughness 0.001
     }
   pigment{color cor_cristal filter 1}
  }
 


#declare tinta1 = 
  texture {
    pigment { color rgb < 0.10, 0.80, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }




#declare tinta2 = 
  texture {
    pigment { color rgb < 0.40, 0.10, 0.70 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }


#declare tinta3 = 
  texture {
    pigment { color rgb < 0.60, 0.10, 0.30 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }


#declare tinta4 = 
  texture {
    pigment { color rgb < 0.0, 0.0, 0.0 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare teste = 
  cylinder{
   <0,0,0>,
   <0,0,4>,
   3
   texture{tx_espelho}
}

#declare cima =
  cone { <0,0,3>, 3
         <0,0,4.5>,1
  texture {tx_espelho2}
}

#declare base =
  torus {3, .3
  texture{tx_espelho2}
  
}


#declare diamante1 =
  lathe {linear_spline
   3,
   <0,-.1>,
   <.4,.1>,
   <0,.3>
   texture {tx_espelho}
}



#declare diamante2 =
  lathe {linear_spline
   3,
   <0,-.2>,
   <.2,.2>,
   <0,.6>
   texture {tx_cristal}
}





#declare fundo =
  plane {z,0
  texture{
   pigment{checker <0,0,0> ,<1,1,1>}
   finish {ambient 0.1 diffuse 0.9}
  scale 0.5
 }
}

#declare cilindro =
  cylinder {
    <-2,1,1>,
    <2,1,1>,
    .8
  texture {Gold_Metal}
 }
   


union{
  object{diamante2 translate <0,-1.8,1>}
  object{diamante2 translate <-1.8,0,1>}
  object{diamante2 translate <1.8,0,1>}
  object{diamante2 translate <0,1.8,1>} 
  object{diamante1 translate <2,0,.8> rotate 45*z }
  object{diamante1 translate <-2,0,.8> rotate 45*z}
  object{diamante1 translate <0,2,.8> rotate 45*z}
  object{diamante1 translate <0,-2,.8> rotate 45*z}
 
 difference{
    object{cima translate <0,0,-3>}  
    object{cilindro translate <1,-1,.8>}
  object{cilindro translate <1,-1,.8> rotate 90*z} 
 }
 object{base rotate 90*x}
 object{fundo}

 
}