// Last edited on 2003-12-09 17:07:40 by stolfi

// LAB-05  -- 25/Set/2003
// ANIMACOES!!

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

#declare ctr = < 0.00, 0.00, 0.00 >;
#declare camDir = < 20.00, 12.00, 7.50 >;

camera {
  location   ctr + 1.00*camDir
  right      -1.00*x
  up         0.75*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 {
  1 * < +3.0, +3.0, +1.5 >             // Posição da lâmpada.
  color rgb 10.0 * < 1.00, 1.00, 1.00 >     // Intensidade e corda luz.
}

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

background{ color rgb < 0.50, 0.50, 1.0 > }

#declare raio = 2.000;
#include "colors.inc"

// ======================================================================
// CORES USADAS
// ======================================================================

#declare bgcolor =
  texture {
    pigment { color rgb < 0.75, 0.80, 0.85 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

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

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

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

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

#declare laranja =
  texture {
    pigment { color rgb < 1.00, 0.70, 0.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

// ======================================================================
// Cristais e Espelhos
// ======================================================================

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

#declare cor_cristal2 =  < 1.00, 0.80, 0.20 >;
#declare tx_cristal2 =
  texture {
    finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1.0 roughness 0.001 }
    pigment { color cor_cristal2 filter 1 }
  }

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

// ======================================================================
// FORMAS USADAS
// ======================================================================

#declare chao =
  plane { <0, 0, 1>, -0.55
         texture {tx_espelho}
  }

#declare chao2 =
  plane { <0, 0, 1>, -0.54
         texture {tx_cristal}
  }

// ======================================================================
// LAB06? - Itens Especificos
// ======================================================================
#declare RR1 = seed(7);
#declare RR2 = seed(12);

#declare cano1 =
cylinder {
    <-19, -20, 0>,     // Center of one end
    <-14, -20, 0>,   // Center of other end
    0.2            // Radius
    open           // Remove end caps
    texture { tx_cristal2 }
  }

#declare cano2 =
cylinder {
    <-20, -19, 0>,     // Center of one end
    <-20, -14, 0>,   // Center of other end
    0.2            // Radius
    open           // Remove end caps
    texture { tx_cristal2 }
  }

#declare noh =
sphere {
  <-20, -20, 0>, 0.5
  texture {laranja}
       }

// ======================================================================
// CENA!
// ======================================================================

object {chao2}

object {cano1 translate <6*0,6*0,0>}
object {cano1 translate <6*1,6*0,0>}
object {cano1 translate <6*2,6*0,0>}
object {cano1 translate <6*3,6*0,0>}

object {cano1 translate <6*0,6*1+1,0>}
object {cano1 translate <6*1,6*1+1,0>}
object {cano1 translate <6*2,6*1+1,0>}
object {cano1 translate <6*3,6*1+1,0>}

object {cano1 translate <6*0,6*2+1,0>}
object {cano1 translate <6*1,6*2+1,0>}
object {cano1 translate <6*2,6*2+1,0>}
object {cano1 translate <6*3,6*2+1,0>}

object {cano1 translate <6*0,6*3+1,0>}
object {cano1 translate <6*1,6*3+1,0>}
object {cano1 translate <6*2,6*3+1,0>}
object {cano1 translate <6*3,6*3+1,0>}

object {cano1 translate <6*0,6*4+1,0>}
object {cano1 translate <6*1,6*4+1,0>}
object {cano1 translate <6*2,6*4+1,0>}
object {cano1 translate <6*3,6*4+1,0>}

object {cano2 translate <6*0,6*0,0>}
object {cano2 translate <6*0,6*1,0>}
object {cano2 translate <6*0,6*2,0>}
object {cano2 translate <6*0,6*3,0>}

object {cano2 translate <6*1,6*0,0>}
object {cano2 translate <6*1,6*1,0>}
object {cano2 translate <6*1,6*2,0>}
object {cano2 translate <6*1,6*3,0>}

object {cano2 translate <6*2,6*0,0>}
object {cano2 translate <6*2,6*1,0>}
object {cano2 translate <6*2,6*2,0>}
object {cano2 translate <6*2,6*3,0>}

object {cano2 translate <6*3,6*0,0>}
object {cano2 translate <6*3,6*1,0>}
object {cano2 translate <6*3,6*2,0>}
object {cano2 translate <6*3,6*3,0>}

object {cano2 translate <6*4,6*0,0>}
object {cano2 translate <6*4,6*1,0>}
object {cano2 translate <6*4,6*2,0>}
object {cano2 translate <6*4,6*3,0>}

object {noh translate <6*0,6*0+0.5,0>}
object {noh translate <6*0,6*1+0.5,0>}
object {noh translate <6*0,6*2+0.5,0>}
object {noh translate <6*0,6*3+0.5,0>}
object {noh translate <6*0,6*4+0.5,0>}

object {noh translate <6*1,6*0+0.5,0>}
object {noh translate <6*1,6*1+0.5,0>}
object {noh translate <6*1,6*2+0.5,0>}
object {noh translate <6*1,6*3+0.5,0>}
object {noh translate <6*1,6*4+0.5,0>}

object {noh translate <6*2,6*0+0.5,0>}
object {noh translate <6*2,6*1+0.5,0>}
object {noh translate <6*2,6*2+0.5,0>}
object {noh translate <6*2,6*3+0.5,0>}
object {noh translate <6*2,6*4+0.5,0>}

object {noh translate <6*3,6*0+0.5,0>}
object {noh translate <6*3,6*1+0.5,0>}
object {noh translate <6*3,6*2+0.5,0>}
object {noh translate <6*3,6*3+0.5,0>}
object {noh translate <6*3,6*4+0.5,0>}

object {noh translate <6*4,6*0+0.5,0>}
object {noh translate <6*4,6*1+0.5,0>}
object {noh translate <6*4,6*2+0.5,0>}
object {noh translate <6*4,6*3+0.5,0>}
object {noh translate <6*4,6*4+0.5,0>}