// Last edited on 2003-12-09 16:48:04 by stolfi
// Exemplo de arquivo de descricao de cena para POV-ray
#include "colors.inc"
#include "metals.inc"

// ======================================================================

#declare ctr = < 2.00, 1.00, 0.00 >;
#declare camDir = (<4.00,3, 4.00 >) - (< 2.00, 1.00, 0.00 >);

camera {
  location   ctr + 1.00*camDir
  right      -48.00*x
  up         36.00*y
  sky        z
  look_at    ctr
}
 

// ======================================================================
// 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.2, 0.50, 0.65 > }

#declare x1=0;
#declare rede= union{ #while (x1<4)
                cylinder{<-2+4*x1,5,0>,<-2+4*x1,-4,0>,0.5 pigment{Red}}
                cylinder{<-2,5-3*x1,0>,<10,5-3*x1,0>,0.5 pigment{Orange}}
               #declare x1=x1+1;
              #end}
      
#declare r1= seed(125);
#declare x2=0;
#declare pacotes=union{ 
#while (x2<1)
sphere{<-2+5*rand(r1),5,0>,0.7 pigment {rgb <rand(r1),rand(r1),rand(r1)>}}
#declare x2=x2+0.2;
#end
#while (x2<2)
sphere{<0+5*rand(r1),5,0>,0.6 pigment {rgb <rand(0.2+r1),rand(r1),rand(r1)>}}
#declare x2=x2+0.4;
#end
#while(x2<3)
sphere{<2+5*rand(r1),5,0>,0.8 pigment {rgb <rand(r1),rand(r1),rand(0.1+r1)>}}
#declare x2=x2+0.5;
#end
}
                 

// Aqui está a cena, finalmente:
object{rede}
#if (clock<0.5) 
object{pacotes translate <-1+2*clock,0,0>}
#else
object{pacotes translate <0,-1+0.1*clock,0>}
#end