// Palácio de Cristal - por Gilberto Sgarbi Filho - RA 001754
// ======================================================================
// CÂMERA 

camera {
  location  < 25, 12, 8 >  	// Posição do observador.
  right     <-0.6, 0, 0>              // Largura RELATIVA da imagem.
  up        <0, 0, 0.8>         // Altura RELATIVA da imagem.      
  sky       <0, 1, 0>           // Qual direção é "para cima"?
  look_at   <0, 0, 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 cor da luz.
} 

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

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

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

#declare raio = 2.5;

#declare cor_cristal =  < 1.00, 1.00, 1.00 >;
#declare tx_cristal =
  texture {
    finish { 
    	ambient 0.1 diffuse 0.1 reflection 0.25
	specular 2.5 roughness 0.01 
    }
    pigment { color cor_cristal filter .7 }
  }

#declare cor_espelho =  < 1, 1, 1 >;
#declare tx_espelho =
  texture {
    finish { 
    	ambient 0.05 diffuse 0.05
	reflection cor_espelho
	specular 0.25 roughness 0.03 
    }
    pigment { rgb cor_espelho }
  }

  
#declare toro = 
  cylinder {
    < 0, 4, 2>,
    < 0, -2, 2 >,
    raio
    texture { tx_cristal }
    interior { ior 1.2 }
  }
      
#declare torre = 
  cone {
    <0, 7, 2>, 0,
    <0, 4, 2>, raio
    texture { tx_espelho }
    interior { ior 1.5 }
  }

#declare parede = 
  box {
    < 1.5, -2, -6 >,
    < -1.5, 2, 6 >
    texture { tx_cristal }
    interior { ior 1.7 }
  }
  
#declare chao =
  box {
    <-4, -3, -8>,
    <9, -3, 8>
    texture { checker texture{tx_cristal}, texture{tx_espelho} }
  }
  
    
// Aqui está a cena, finalmente:

union {
  object { chao }
  object { toro }
  object { torre }
  object { parede }
  object { parede texture { tx_espelho }
  		  rotate 90*x
  		  translate <-6,0,-7> }
}