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

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

camera {
  location  <  8, 5.00, 30.00 >  // Posição do observador.
  right     -0.75*x                // Largura RELATIVA da imagem.
  up        1.00*y                 // Altura RELATIVA da imagem.      
  sky       y                      // Qual direção é "para cima"?
  look_at   <  8, 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.
} 

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

background{ color rgb < 0.75, 0.80, 0.85 > }

#declare raio = 2.000;

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

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

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

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

#declare c = clock;  
    
#declare dedo = 
cone{ 
<0,0,0>,0.5
<3,0,0>,0
pigment {color rgb <0.4,0.5,0.7>}
}

#declare mao = 
union{
object{dedo}
object{dedo rotate 60*z}
object{dedo rotate 30*z}
object{dedo rotate -30*z}
object{dedo rotate -60*z}
translate <3,0,0>
}

#declare junta1 = 
union{
cylinder {
<0,0,0>
<0.1,0,0>,0.8
pigment {color rgb <0.6,0.8,0.7>}
translate <2.9,0,0>
}
#if(c<=0.5)
object {mao rotate 80*(1-2*c)*x}
#else
object {mao}
#end
}


#declare antibraco1 = 
union{
cylinder{
<0,0,0>,
<1,0,0>,0.5
pigment {color rgb <0.7,0.5,0.7>}
translate <2,0,0>
}
object{junta1}
#if(c<=0.5)
rotate 40*z
#else
#if(c<=0.7)
rotate 40*5*(0.7-c)*z
#else
rotate 35*(10/3)*(c-0.7)*z
#end
#end
}

#declare junta2 = 
cylinder {
<0,0,0>
<0.1,0,0>,0.8
pigment {color rgb <0.8,0.3,0.2>}
translate <1.9,0,0>
}

#declare antibraco2 = 
union{
union{
box{
<0,0,0>,
<2,1,1>
pigment {color rgb <0.2,0.3,0.4>}
translate <0,-0.5,-0.5>
}
object{junta2}
#if(c<=0.5)
rotate 40*z
#else
#if(c<=0.7)
rotate 40*5*(0.7-c)*z
#else
rotate 35*(10/3)*(c-0.7)*z
#end
#end

}
object{antibraco1}
}


#declare junta3 = 
cylinder {
<0,0,0>
<0.1,0,0>,0.8
}

#declare junta3T = 
union{
object {junta3 translate <-2.1,0,0> pigment {color rgb <0.3,0.9,0.8>}}
object {junta3 translate <-2.2,0,0> pigment {color rgb <0.4,0.8,0.7>}}
object {junta3 translate <-2.3,0,0> pigment {color rgb <0.5,0.7,0.6>}}
object {junta3 translate <-2.4,0,0> pigment {color rgb <0.6,0.6,0.5>}}
object {junta3 translate <-2.5,0,0> pigment {color rgb <0.7,0.5,0.4>}}
}

#declare antibraco3 = 
torus{
1,0.1
pigment {color rgb <0.1,0.4,0.7>}

}


#declare antibraco3T = 
union{
object{antibraco3 translate <-1,0.5,0>}
object{antibraco3 rotate 30*x translate <-1,0.5,0>}
object{antibraco3 rotate 60*x translate <-1,0.5,0>}
object{antibraco3 rotate 90*x translate <-1,0.5,0>}
object{antibraco3 rotate 120*x translate <-1,0.5,0>}
object{antibraco3 rotate 150*x translate <-1,0.5,0>}
object{antibraco3 rotate 180*x translate <-1,0.5,0>}
object{antibraco3 rotate 210*x translate <-1,0.5,0>}
object{antibraco3 rotate 240*x translate <-1,0.5,0>}
object{antibraco3 rotate 270*x translate <-1,0.5,0>}
object{antibraco3 rotate 300*x translate <-1,0.5,0>}
object{antibraco3 rotate 330*x translate <-1,0.5,0>}
object{antibraco2}
}

#declare ombro = 
union{
cylinder {
<0,0,0>,
<2.5,0,0>,
1.0
translate <-5,0,0>
pigment {color rgb <0.9,0.8,0.7>}
}
object {antibraco3T rotate 30 * z}
object {junta3T }

}

 
#declare braco = 
union {
object{ombro}
}

#declare bracoF = 
object {braco translate <5,0,0>}

#declare corpo=
union{
cylinder{
<0,0,0>,
<0,4,0>,
2
translate <-1,-1,0>
pigment {rgb <0.9,0.8,0.7>}
}
sphere{
<0,0,0>,
2
translate <-1,5,0>
pigment {rgb <0.9,0.8,0.7>}
}
}
#declare ladrao = 
union{
cylinder{
<0,0,0>
<0,4,0>,1.0
pigment {color rgb <2,3,6>}
translate <9,-2,0>
}
}

// Aqui está a cena, finalmente:

  union {  
  object{bracoF translate <0,0,-1> }
  object {bracoF translate <0,0,1> }
  object {corpo}
  #if(c<=0.7)
  object {ladrao}
  #else
  object{ladrao rotate 30*(10/3)*(c-0.7)*z}
  #end
  }