// Aula 2 - 21/09/2004 - Bigorna dobravel
// Andre Vinicius Buzzo - Ra: 001356

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

camera {
  location  <  15, 15, 20 >  // Posição do observador.
  right     -1.00*x                // Largura RELATIVA da imagem.
  up        0.75*y                 // Altura RELATIVA da imagem.      
  sky       z                      // Qual direção é "para cima"?
  look_at   <  5, 3.00, 1.00 >  // Para onde a câmera está apontando.
  rotate 270*x
} 
// 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.7 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
}

light_source {
  10 * < -50.0, -30.0, -50.0 >              // Posição da lâmpada.
  color rgb 1.7 * < 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 tinta_A = 
  texture {
    pigment { color rgb < 1, 0, 0 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

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

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

#declare tinta_D = 
  texture {

    pigment { color rgb < 1, 1, 0 >}
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }
  
#declare pino_bico = 
  cylinder {
    < 12.00, 3.00, 1.00 >,
    < 11.00, 3.00, 1.00 >,
    0.2
    texture { tinta_A }
  }

#declare pino_base = 
  cylinder {
    < 5.00, -1.00, 1.00 >,
    < 5.00, 0.00, 1.00 >,
    0.2
    texture { tinta_B }
  }
  
#declare pino_caixinha = 
  cylinder {
    < 3.25, 6.00, 1.00 >,
    < 3.25, 5.00, 1.00 >,
    0.1
    texture { tinta_D }
  }

#declare pino_bico_buraco = 
  cylinder {
    < 9.00, 3.00, 1.00 >,
    < 7.00, 3.00, 1.00 >,
    0.2
    texture { tinta_C }
  }

#declare pino_base_buraco = 
  cylinder {
    < 5.00, 1.90, 1.00 >,
    < 5.00, 3.00, 1.00 >,
    0.2
    texture { tinta_C }
  }
  
#declare pino_caixinha_buraco = 
  cylinder {
    < 3.25, 4.10, 1.00 >,
    < 3.25, 3.00, 1.00 >,
    0.1
    texture { tinta_C }
  }


# declare caixa_central =
   box {
    <2, 2, 0>,  // Near lower left corner
    < 8, 4, 2>   // Far upper right corner
    texture { tinta_C }
  }

#declare cone_bico =
  cone {
    <12, 3, 1>, 1    // Center and radius of one end
    <14, 3, 1>, 0    // Center and radius of other end
    texture { tinta_A }
  }

#declare cone_base =
  cone {
    <5, -1, 1>, 1    // Center and radius of one end
    <5, -5, 1>, 3.0    // Center and radius of other end
    texture { tinta_B }
  }


# declare caixinha =
   box {
    <3, 6, 0>,  // Near lower left corner
    < 3.5, 6.5,  2>   // Far upper right corner
    texture { tinta_D }
  }


difference { 
 object { caixa_central }
 object { pino_caixinha_buraco }
 object { pino_bico_buraco }
 object { pino_base_buraco }
}
 
union {
 object { cone_bico}
 object { pino_bico}
}

union {
  object { cone_base}
  object { pino_base}
}

union {
  object { caixinha}
  object { pino_caixinha}
}