// ====================================================================== // LABORATÓRIO 06 - COMPUTAÇÃO GRÁFICA // O LONGO BRAÇO DA LEI // RAFAEL LAMARE SILVEIRA 009669 // DESCRIÇÃO: ESTUDO DE ARTICUÇÕES. DEDOS ARTICULADOS ÀS MÃOS; // MÃO ARTICULADA AO ANTEBRACO; ANTREBRAÇO ARTICULADO AO BRAÇO, // CUJO BÍCEPS VARIA DE VOLUME QUANDO CONTRAI-SE O ANTEBRAÇO; // ANTEBRAÇO ARTICULADO AO OMBRO QUE O FAZ GIRAR. // ====================================================================== #include "colors.inc" #declare semente = seed(4345); // 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 < 20.00, 20.00, 20.00 > // Posição do observador. right -1.0*x // Largura RELATIVA da imagem. up 0.75*y // Altura RELATIVA da imagem. sky -z // Qual direção é "para cima"? look_at < 10, 0, -5 > // 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 tx_cristal = texture { finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color rgb <0.5, 0.5, 1.0> filter 1 } } #declare tx_cristal2 = texture { finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color Brown filter 1 } } #declare cor_espelho = <1.0, 1.0, 0.3> ; #declare tx_espelho = texture { pigment { color rgb <1.00, 1.00, 1.00> } finish { ambient 0.05 diffuse 0.05 reflection cor_espelho specular 0.20 roughness 0.05 metallic } } #declare pintura = texture { pigment { color Gray60 } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } //=========================================================================== // VARIÁVEIS DE CONTROLE // Variáveis das articulações #declare alfa = 0; // mao #declare beta = 80; // antebraco #declare tau = 45; // dedos #declare phi = clock*360; // giro do braco //controle do beta #if (clock < 0.5) #declare beta = beta + 80*2*clock ; #else #declare beta = beta + 80*2*(1-clock); #end // Controle do biceps baseado na // inclinacao do antebraco #declare biceps = (beta/80)*2.0; //controle do alfa #if (clock < 0.25) #declare alfa = 45*4*clock; #else #if (clock < 0.5) #declare alfa = 45 - 45*4*(clock - 0.25); #else #if (clock < 0.75) #declare alfa = -45*4*(clock - 0.50); #else #declare alfa = -45 + 45*4*(clock - 0.75); #end #end #end // controle de tau #if (clock < 0.25) #declare clockinho = 4*clock; #else #if (clock < 0.5) #declare clockinho = 4*(clock - 0.25); #else #if (clock < 0.75) #declare clockinho = 4*(clock - 0.50); #else #declare clockinho = 4*(clock - 0.75); #end #end #end #if (clockinho < 0.5) #declare tau = tau + 45*2*clockinho ; #else #declare tau = tau + 45*2*(1-clockinho); #end // ====================================================================== // OBJETOS #declare dedos = union { #declare i = 1; #while (i < 5) object { cylinder { <0,0,0>, <5.5,0,0>, 0.5 rotate <0, tau + i*20, 20*i - 40> pigment { Green } } } #declare i = i + 1; #end } #declare mao = union { cylinder { <0,0,0>, <0,0,1>, 2 pigment { Yellow } } object { dedos translate <1.0,0,0> } } #declare anteBraco = union { cone { <0,0,0>, 2.0, <12,0,0>, 1.5 pigment { Red } } sphere { <1,0,0>, 2.0 pigment { Red } } sphere { <12,0,0>, 1.5 pigment { Yellow } } object { mao rotate <0,alfa,0> translate <12,0,0> } } #declare braco = union { sphere { <0,0,0>, 2.8 pigment { Yellow } } union { cone { <0,0,0>, 1.5, <7,0,0>, biceps pigment { Brown } } cone { <7,0,0>, biceps, <14,0,0>, 1.5 pigment { Brown } } } object { anteBraco rotate <0,beta,0> translate <14,0,0> } rotate } object { braco }