// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited on 2003-09-04 15:25:26 by stolfi

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

 
#include "textures.inc"
#include "colors.inc" 


camera {
  location  6*<5, 10, 10 >  // Posição do observador.
  right     -1*x                // Largura RELATIVA da imagem.
  up        .75*y                 // Altura RELATIVA da imagem.      
  sky       z                      // Qual direção é "para cima"?
  look_at   <  0.00, 0.00, 0 >  // Para onde a câmera está apontando.
} 
// 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.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.
} 

light_source {
  < 0, -12.75, 2 >             // Posição da lâmpada.
  color rgb < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
} 

light_source {
  < 0, -12.75, 5.5 >             // Posição da lâmpada.
  color rgb 0.4 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
} 

light_source {
  < 0, -12.75, 4 >             // Posição da lâmpada.
  color rgb 0.5 * < 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 tinta1 = 
  texture {
    pigment { color rgb < 0.10, 0.80, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }




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


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


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

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

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





#declare dedo =
  cylinder {<0,0,0>,<3,0,0>, .3
            texture {tinta2}
           }

#declare palmadamao =
  
  box{<-1,-.1,-.5>,<1,.1,.5>
    texture{tinta1}
  }


#declare tempo = clock;
#declare ang1= 50*sin(2*pi*clock);
#declare ang2= 30*sin(1*pi*clock);
#declare ang3= 30*sin(10*pi*clock);
#declare ang4= 180*sin(10*pi*clock);



#declare mao=

  union{ 
    object{palmadamao scale <2.5,4,4>}
    object{dedo rotate .3*clock*180*z translate <2,0,.5>}
    object{dedo rotate .5*clock*100*z translate <2,0,-1.6>}
    object{dedo rotate .8*clock*150*z translate <2,0,1.6>}
    object{dedo rotate 1*clock*30*z translate <2,0,-.5>}
    
    object{dedo rotate 90*y translate <0,0,4> scale<1.5,1,1>}
    
  }



#declare maocom1braco=
   union{
    
    cylinder{<0,0,0>,<10,0,0>,1.5 texture{tinta5}}
    #if(tempo < 0.5)
       object{mao rotate clock*50*z rotate  ang3*y translate<12,0,0>}
    #else 
       object{mao rotate y*25 rotate (clock-0.5)*50*z translate<12,0,0>}
    #end
    }


#declare maocom2braco=
   union{
     cylinder{<0,0,0>,<10,0,0>,1.5 texture{tinta1}}
     object {maocom1braco  rotate ang1*y translate <10,0,0>}
   }



           

#declare eixoX =
  cylinder {<-300,0,0>,<300,0,0>,.1
            texture {tinta1}
           }

#declare eixoY =
  cylinder {<0,-300,0>,<0,300,0>,.1
            texture {tinta2}
           }

#declare eixoZ =
  cylinder {<0,0,-300>,<0,0,300>,.1
           texture {tinta3}
           }

#declare eixos= 
  union{
   object{eixoX}
   object{eixoY}
   object{eixoZ}
  }


#declare corpo =
  union{
   box{ <0,0,0>,<2,2,4> texture{tinta1}}
   box{ <0.75,0.75,4>, <1.5,1.5,6>texture{tinta1} }
   box{ <0.25,0.75,6>,<1.75,1.75,8>texture{tinta1}}
}

#declare corpocombracos =
  union{object{corpo scale <4,4,4> translate <-4,-4,-14>}
  
  #if (tempo<0.5)
     object{ maocom2braco rotate (clock)*180*z translate <4,0,0>}
     object{ maocom2braco scale -1*x rotate -clock*180*z translate <-4,0,0> }
     
  #else
     object{ maocom2braco rotate 180*y rotate 180*x rotate -90*z translate <-4,0,0> }
     object{ maocom2braco rotate 90*z translate <4,0,0>}
  #end
}

#declare bandido =
  #if(tempo<0.5)
    cylinder {<0,0,0>,<10,0,0>,3 texture {tinta2} rotate y*90 scale <1.5,1.5,2> translate <0,24,5>}
  #else
    cylinder {<0,0,0>,<10,0,0>,3 texture {tinta2} rotate y*90 scale <1.5,1.5,2> translate <0,24,5> 
                                                                      rotate -1*ang1*x}
  #end


#declare fundo =
  plane {z,0
  texture{Jade}
  scale 0.5
}


union{
  object{bandido}
  object{corpocombracos}
  object{eixos}
 }