// Exemplo de arquivo de descricao de cena para POV-ray

// ======================================================================
// CORES E TEXTURAS

background{ color rgb < 1.00, 1.00, 1.00 > }

#declare tx_plastico = 
  texture{
    pigment{ color rgb < 0.71, 0.45, 0.19 > }
    finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 }
  }

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

#declare tx_xadrez =
  texture{
    pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 2.0
  }
#declare tx_xadrez2 =
  texture{
    pigment{ checker color rgb < 0.60, 0.32, 0.10 >, color rgb < 1.00, 0.97, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 2.0
  }

#declare tx_vidro = 
  texture{
    pigment{ color rgb < 0.9, 0.55, 0.00 > filter 0.90 }
    finish{ diffuse 0.05 ambient 0.00 }
  }

#declare tx_vidro2 = 
  texture{
    pigment{ color rgb < 0.45, 0.75, 0.50 > filter 0.90 }
    finish{ diffuse 0.05 ambient 0.00 }
  }


// ======================================================================
// DECLARAÇÃO DE OBJETOS

#declare raio = 2.000;

// Partes da cena:

#include "eixos.inc"

#declare chao = 
  box{ <-100,-100,-1>, <+100,+100,0> }
  
#declare phi = ( sqrt(5) + 1 ) / 2;

// ======================================================================
// DESCRIÇÃO DE MACROS
#macro dodecaedro()
#local dist=2;
intersection{
  plane{<+1,0,+phi>,dist}
  plane{<+1,0,-phi>,dist}
  plane{<-1,0,+phi>,dist}
  plane{<-1,0,-phi>,dist}
  plane{<+phi,+1,0>,dist}
  plane{<+phi,-1,0>,dist}
  plane{<-phi,+1,0>,dist}
  plane{<-phi,-1,0>,dist}
  plane{<0,+phi,+1>,dist}
  plane{<0,+phi,-1>,dist}
  plane{<0,-phi,+1>,dist}
  plane{<0,-phi,-1>,dist}
}
#end

#macro octaedro()
#local dist=2;
intersection{
  plane{<+1,+1,+1>,dist}
  plane{<+1,+1,-1>,dist}
  plane{<+1,-1,+1>,dist}
  plane{<+1,-1,-1>,dist}
  plane{<-1,+1,+1>,dist}
  plane{<-1,+1,-1>,dist}
  plane{<-1,-1,+1>,dist}
  plane{<-1,-1,-1>,dist}
}
#end

#macro icosaedro()
intersection{
  object{ octaedro() }
  object{ dodecaedro() scale<1.07,1.07,1.07> }
}
#end

#macro cubo()
#local dist=2;
intersection{
  plane{<0,0,+1>,dist}
  plane{<0,0,-1>,dist}
  plane{<0,-1,0>,dist}
  plane{<0,+1,0>,dist}
  plane{<+1,0,0>,dist}
  plane{<-1,0,0>,dist}
}
#end

#macro inter_cubo_octa()
intersection{
 object{ cubo() }
 object{ octaedro() scale<1.15,1.15,1.15> }
}
#end

// ======================================================================
// ANIMAÇÃO

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

union{
  object { chao translate < 0,0,-10 > texture{tx_xadrez} }
  object { icosaedro() texture{tx_vidro} interior{ ior 1.4} translate<0,3,0> }
  object { inter_cubo_octa() texture{tx_vidro2} interior{ior 1.2} translate<0,-3,0>}

  //object{ eixos(4) }

}


#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 1.00 >;
#declare raio_cena = 12;
#declare dir_camera = < 12.00, 0.0, 3.00 >;
#declare dist_camera = 11.00;
#declare intens_luz = 1.00;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)