//A linha do trem tem um raio tao grande que se torna uma reta...
//(Eu fiz uma reta...pois temos muito pouco tempo para fazermos nossos trabalhos.)


// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited by Botuca at 19 de Outubro de 2004

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

camera {
  location  <  30.00, 4.00, 16.00 >  // 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   <  0.00, 0.00, 0.00 >  // 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 tinta_A = 
  texture {
    pigment { color rgb < 0.90, 0.80, 0.60 > }
    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.40, 0.80, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

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

#declare cor_prata = <0.7 0.7 0.8>;
#declare tx_prata =
   texture {
     pigment { rgb cor_prata }
     finish {
       ambient 0.05 diffuse 0.1
       reflection cor_prata
       specular 0.3 roughness 0.7
     }
   }

#declare cor_ouro =  < 1.00, 0.80, 0.10 >;
#declare tx_ouro =
   texture {
     pigment { rgb cor_ouro }
     finish {
       ambient 0.05 diffuse 0.05
       reflection cor_ouro
       specular 0.20 roughness 0.05
     }
   }

#declare xx = clock;
   #if (xx<0.25)
	#declare dedopos = -80*xx;
   #else
	#declare dedopos = -20;
   #end


#declare yy = clock;
   #if (yy>0.25)
	#declare bracopos1 = -80*(xx-0.25);
   #else
	#declare bracopos1 = 0;
   #end


#declare zz = clock;
   #if (zz>0.5)
	#declare bracopos2 = -80*(xx-0.5);
   #else
	#declare bracopos2 = 0;
   #end

#declare tt = clock;
   #if (tt>0.75)
	#declare corpopos1 = -200*(xx-0.75);
   #else 
	#declare corpopos1 = 0;
   #end
  


#declare falange = 
	box {   <0.00, +0.25, -0.15>
		<1.50, -0.25, +0.15>
		texture { tx_ouro } 
	}

#declare dedo = 
	union {
		object {falange rotate -45*y}
		object {falange rotate 45*y translate <1.0, 0, 1.0> }
	}

#declare dedo1 =
	object { dedo rotate -40*y }

#declare dedo2 =
	object { dedo rotate 180*x rotate 40*y }

#declare mao =
	union {
		sphere { <0,0,0>, 0.4 
			texture { tinta_B }
		}
		object { dedo1 rotate 90*x translate <0.2, 0, 0>}
		object { dedo2 rotate 90*x translate <0.2, 0, 0>}
	}

#declare antebraco =
	union {
		cylinder { <0.2,0,0>
			   <6,0,0>
			   0.25
			   texture { tx_prata }
		}
		object { mao rotate (80+bracopos1)*z translate < 6.2, 0, 0 > }
		sphere { <0,0,0>, 0.4 
			texture { tinta_B }
		}
	}

#declare braco =
	union {
		cylinder { <0.2,0,0>
			   <6,0,0>
			   0.25
			   texture { tx_ouro }
		}
		object { antebraco rotate -2*bracopos1*z translate < 6.2, 0, 0 > }
		sphere { <0,0,0>, 0.4 
			texture { tinta_B }
		}
	}

#declare braco_direito =
	object { braco rotate (-20-dedopos)*z rotate bracopos1*z rotate bracopos2*y}

#declare braco_esquerdo =
	object { braco_direito scale <1,-1,1> }

#declare base =
	union {
		cylinder { <0,0,3>
			   <0,0,-3>
			   1.5
			   texture { tx_prata }
		}
		object { braco_direito translate<0,-1.5,1>}
		object { braco_esquerdo translate <0,1.5,1>}
		
	}

#declare bandido =
	box { <1,1,2>
	      <-1,-1,-2>
	      texture { tinta_A }
	}	

#declare chao = 
    plane { z, -3.51
         texture {
              pigment { checker <0,0,0>, <1,1,1>}
              finish { ambient 0.1 diffuse 0.9 }
              scale 5
       }
   }

#declare alicerce =
	union {
		box {   <2.00, +2.00, -3.01>
			<-2.00, -2.00, -3.5>
			texture { tx_ouro }
		}
		object { base rotate corpopos1*z}
		object { chao }
	}
		
union {
	object { alicerce }
	object { bandido translate <12,0,1> translate -0.00148*<bracopos1*bracopos1,0,0> rotate bracopos2*y rotate corpopos1*z}
}