#include "colors.inc"
// ======================================================================
// CÂMERA 

camera {
  location  <5.0, -5, -46.0>
  right     -1.0*x                // Largura RELATIVA da imagem.
  up        0.5*y                 // Altura RELATIVA da imagem.     
  direction 1.5*z
  look_at   <5, 0, 0>
  rotate 10*x 
  //rotate -180*y
  //rotate 70*y
}
// 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 {
  <0, 0, 0>    
  color rgb <1, 1, 1>
  translate <10, 10, -50>
  rotate -30*y
  //rotate -180*y
}

light_source {
  10 * < +50.0, +30.0, +50.0 >              // Posição da lâmpada.
  color rgb < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
  rotate 60*y
  //rotate -180*y
} 

/*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 

#declare fonte=seed(314159);

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}

#declare tx_espelho =
  texture{
    pigment {Gray70}
    finish{
      ambient 0.05 diffuse 0.05
      reflection{
         Silver
         metallic
       }
      specular 0.20 roughness 0.05
    }
  }

#declare tx_pedras =
  texture{
     finish {
         ambient 0.1 diffuse 0.1 reflection 0.25
         specular 1 roughness 0.001
     }
     pigment {color rgb <0, 1, 1>}
  }


#declare dedo =
cylinder{
   0, <1,0,0>,      
   0.18
   pigment {color Cyan}
}

#declare juncao =
sphere{
   0, 0.75
   pigment {color Green}
}

#declare mao =
 #declare t1 = clock;
 union{
  box{
     <0,-1,-0.5> <2, 1, 0.5>
     pigment{color Blue}
  }
  //colocar os dedos
  object{
    dedo
    rotate -60*t1*y
    translate<1.9,0,0>
  }
  object{
    dedo
    //rotate 20*y
    translate<1.9,0.55,0>
  }
  object{
    dedo
    rotate -40*t1*y
    translate<1.9,-0.55,0>
  }
}

#declare antebraco = 
 #declare t2 = clock;
 union{

   cylinder{
    0, <6,0,0>
    0.75
    pigment {color Yellow}
   }

   object{
     juncao
     translate <6.75, 0, 0>
   }

   object {
    mao
    rotate 45*t2* x
    translate <7.5,0,0>
   }

}


#declare braco =
 #declare t3 = clock;
 union{

  cylinder{
   0, <9,0,0>
   0.75
   pigment {color Yellow}
  }

  object {
     juncao 
     translate <9.75,0,0>
  }

 object {
    antebraco
    rotate 50*t3*z
    translate <10.5,0,0>
  }

 object {
   juncao
   translate <-0.75,0,0>
 }

}


/********************** CENA ******************************/
#declare t4 = clock;
object{braco rotate -50*t4*y }