// MC930 - Exercicio 6 - O braco da Lei // 9/11/2004 // Pablo Augusto Verissimo - RA 002266 #include "colors.inc" #include "metals.inc" #include "stones.inc" #include "textures.inc" #include "skies.inc" // ====================================================================== // CÂMERA camera { location < 60,60,60 > // 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, 0, 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 * < 0.90, 0.70, 0.80 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.9, 0.9, 0.9 > } #declare beta = -70*clock; #declare alfa = -35*clock; #declare gama = 0 + (-20-0)/(1 - 0.4)*(clock - 0.4); #declare epsilon = -40*clock; #declare abraco = -20*clock; #declare dedos = union { box { <0,-0.4,-0.4>,<3,0.4,0.4> pigment { Blue } } box { <0,-0.4,-0.4>,<3,0.4,0.4> pigment { Blue } translate -1*y } box { <0,-0.4,-0.4>,<3,0.4,0.4> pigment { Blue } translate 1*y } sphere { <-0.3,0,0>,0.7 pigment { Yellow } } sphere { <-0.3,0,0>,0.7 pigment { Yellow } translate -1*y } sphere { <-0.3,0,0>,0.7 pigment { Yellow } translate 1*y } } #declare mao = union { box { <0,-1.5,-1>,<4,1.5,1> pigment { Blue } } object { dedos rotate epsilon*z translate <4.3,0,0> } } #declare antebraco = union { cylinder { <0,0,0>,<7,0,0>,1.5 pigment { Blue } } sphere { <8,0,0>,1.6 pigment { Yellow } } #if (clock < 0.4) object { mao rotate 90*x rotate alfa*x translate <9,0,0> } #else object { mao rotate 90*x translate <9,0,0> } #end } #declare bracodireito = union { cylinder { <0,0,0>,<9,0,0>,1.9 pigment { Blue } } sphere { <10,0,0>,2 pigment { Yellow } } object { antebraco rotate beta*y translate <12,0,0> } } #declare bracoesquerdo = object { bracodireito scale <+1,-1,+1> } #declare criminal = cylinder { <30,0,0>,<30,0,15>,4.5 pigment { checker <0,0,0>,<1,1,1> } } #declare corpo = union { box { <-8,-8,-5>,<8,8,5> pigment { Blue } } sphere { <10,-6,3>,2 pigment { Yellow } } sphere { <10,6,3>,2 pigment { Yellow } } //cabeca sphere { <0,0,14>,6 pigment { Yellow } } //pescoco cylinder { <0,0,4>,<0,0,9>,2 pigment { Yellow } } //olho sphere { <4,-3.7,16>,1.7 pigment { Red } } //olho sphere { <4,3.7,16>,1.7 pigment { Red } } //boca cylinder { <0,0,13>,<6.5,0,13>,1.8 pigment { Red } } #if (clock < 0.4) object { bracodireito rotate -abraco*z translate <12,-6,3> } object { bracoesquerdo rotate abraco*z translate <12,6,3> } object { criminal } #else object { bracodireito rotate 6*z rotate gama*y translate <12,-6,3> } object { bracoesquerdo rotate -6*z rotate gama*y translate <12,6,3> } object { criminal rotate gama*y } #end } plane { z,-5 texture {T_Grnt24} } //**************************** //Aqui está a cena, finalmente: //**************************** object { corpo }