// 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  <  -80.00, 80.00, 85.00 >  // Posição do observador.
  right     -1.00*x                // Largura RELATIVA da imagem.
  up        0.5*y                 // Altura RELATIVA da imagem.      
  sky       z                      // Qual direção é "para cima"?
  look_at   <  5.00, 10.00, -10.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 < 1, 0, 0 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

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

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

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

#declare cor_espelho = 
 pigment {color rgb <0.01, 0.01, 0.01>}

#declare tx_cristal =
  texture{
    finish{
      ambient 0.1 diffuse 0.1 reflection 0.25
      specular 1 roughness 0.001
    }
    pigment{color rgb <1.00, 0.50, 0.50> filter 1}
  } 
 
#declare tx_espelho =
  texture{
   pigment{rgb <0.00, 0.80, 0.80>}
   finish{
      ambient 0.05 diffuse 0.05 
      reflection rgb <0.80, 0.80, 0.80>
      specular 0.20 roughness 0.05
    }
  }

       
#declare dedo = 

	union{
	union{
		object{
			cylinder{<0,0,0>, <15,0,0>, 0.2}	
		}
		texture{tx_espelho}
	}
	union{
		object{
			sphere{<15,0,0>, 0.4}
		}
		texture{tinta_A}
	}
	}
 
#declare mao = 

	union{
		object{
			cylinder{<0,0,0>, <5,0,0>, 1}	
			texture{tx_espelho}
		}
		object{dedo translate<5,0,0>}
	}

#declare mao1 = 

	union{
		object{
			cylinder{<0,0,0>, <0,0,5>, 1}	
			texture{tx_espelho}
		}
		object{dedo rotate -90*y translate<0,0,5>}
	}

#declare mao2 = 

	union{
		object{
			cylinder{<0,0,0>, <0,0,5>, 1}	
			texture{tx_espelho}
		}
		object{dedo rotate -90*y translate<0,0,5>}
	}

	
#declare parte1 =

	union{
		object{
			cylinder{<0,0,0>,<10,0,0>, 1.5}
			texture{tx_espelho}
		}
		#if (clock < 0.3)
			#declare a = -50*clock + 15;
		#else
			#declare a = 0;
		#end
		#declare b = -30*clock;
		#declare c = 30*clock;
		object{mao rotate a*y translate<10,0,0>}
		object{mao1 rotate b*x translate<7,0,0>}
		object{mao2 rotate c*y translate<3,0,0>}
	}

#declare parte2 =

	union{
		object{
			cylinder{<0,0,0>,<10,0,0>, 2}
			texture{tx_espelho}
		}
		#if (clock <= 0.8)
			#declare g = 80*clock;
			#declare f = 0;
		#end
		#if (clock > 0.8)
			#declare g = 64;
			#declare f = -80*clock + 64;
		#end
		object{parte1 rotate g*z rotate f*y translate<10,0,0>}
	}

#declare parte3 =

	union{
		object{
			cylinder{<0,0,0>,<9,0,0>, 2.5}
			texture{tx_espelho}
		}
		#if ((clock > 0.4) & (clock <= 0.7))
			#declare d = -90*clock + 36;
		#end
		#if (clock <= 0.4)
			#declare d = 0;
		#end
		#if (clock > 0.7)
			#declare d = -27;
		#end
		object{parte2 rotate d*y translate<9,0,0>}
	}

#declare braco_direito =

	union{
		object{
			cylinder{<0,0,0>,<8,0,0>, 3}
			texture{tx_espelho}
		}
		#if (clock < 0.8)
			#declare e = 80*clock;
		#else
			#declare e = 64;
		#end
		object{parte3 rotate e*z translate<8,0,0>}
	}
	

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

#declare olho =
	object{
		sphere{<0, 5, 13>,0.5}
		texture{tinta_P}
	}

#declare cabeca = 
	union{
		object{
			cylinder{<0,0,9>,<0,0,18>, 5}
			texture{tx_espelho}
		}
		object{olho}
		object{olho rotate 30*z}
		object{olho rotate 60*z}
		object{olho rotate 90*z}
		object{olho rotate 120*z}
		object{olho rotate 150*z}
		object{olho rotate 180*z}
		object{olho rotate 210*z}
		object{olho rotate 240*z}
		object{olho rotate 270*z}
		object{olho rotate 300*z}
		object{olho rotate 330*z}
	}
	
#declare corpo = 
	union{
		object{
			box {<8, -5, -12>, <-8, 5, 9>}
			texture{tx_espelho}
		}
		object{braco_direito translate<8,0,0>}
		object{braco_esquerdo translate<-8,0,0>}
		object{cabeca}
	}
		
// Aqui está a cena, finalmente:
union{
object{corpo}
}