#include "colors.inc" #include "stones.inc" #include "textures.inc" // Trabalho 2 de MC930 // ====================================================================== // CÂMERA camera { location < 20.00, 25.00, 20.00 > // Posição do observador. right -0.75*x // Largura RELATIVA da imagem. up 1.00*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < -10.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 dedo1 = union { //Dedo 1 sphere{ < 0, 2.5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 0, 2.5, 0>, // Center of one end < 1, 2.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Cyan} } } sphere{ < 1, 2.5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 1, 2.5, 0>, // Center of one end < 2, 2.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Green} } } sphere{ < 2, 2.5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 2, 2.5, 0>, // Center of one end < 2.5, 2.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Blue} } } sphere{ < 2.5, 2.5, 0>, 0.5 texture { pigment {color Blue}} } } #declare dedo2 = union { sphere{ < 0, 1, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 0, 1, 0>, // Center of one end < 1.2, 1, 0>, // Center of other end 0.5 // Radius texture { pigment {color Cyan} } } sphere{ < 1.2, 1, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 1.2, 1, 0>, // Center of one end < 2.4, 1, 0>, // Center of other end 0.5 // Radius texture { pigment {color Green} } } sphere{ < 2.4, 1, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 2.4, 1, 0>, // Center of one end < 3.1, 1, 0>, // Center of other end 0.5 // Radius texture { pigment {color Blue} } } sphere{ < 3.1, 1, 0>, 0.5 texture { pigment {color Blue}} } } #declare dedo3 = union { sphere{ < 0, -0.5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 0, -0.5, 0>, // Center of one end < 1.3, -0.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Cyan} } } sphere{ < 1.3, -0.5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 1.3, -0.5, 0>, // Center of one end < 2.6, -0.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Green} } } sphere{ < 2.6, -0.5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 2.6, -0.5, 0>, // Center of one end < 3.3, -0.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Blue} } } sphere{ < 3.3, -0.5, 0>, 0.5 texture { pigment {color Blue}} } } #declare dedo4 = union { sphere{ < 0, -2, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 0, -2, 0>, // Center of one end < 1.2, -2, 0>, // Center of other end 0.5 // Radius texture { pigment {color Cyan} } } sphere{ < 1.2, -2, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 1.2, -2, 0>, // Center of one end < 2.4, -2, 0>, // Center of other end 0.5 // Radius texture { pigment {color Green} } } sphere{ < 2.4, -2, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 2.4, -2, 0>, // Center of one end < 3.1, -2, 0>, // Center of other end 0.5 // Radius texture { pigment {color Blue} } } sphere{ < 3.1, -2, 0>, 0.5 texture { pigment {color Blue}} } } #declare dedo5 = union { sphere{ <-0.2, -3, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < -0.2, -3, 0>, // Center of one end < 0.4, -4, 0>, // Center of other end 0.5 // Radius texture { pigment {color Cyan} } } sphere{ < 0.4, -4, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 0.4, -4, 0>, // Center of one end < 1.0, -5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Green} } } sphere{ < 1.0, -5, 0>, 0.55 texture { pigment {color Brown}} } cylinder { < 1.0, -5, 0>, // Center of one end < 1.3, -5.5, 0>, // Center of other end 0.5 // Radius texture { pigment {color Blue} } } sphere{ < 1.3, -5.5, 0>, 0.5 texture { pigment {color Blue}} } } #declare delta = abs(270*clock - 135); #declare mao = union{ box { < 0, -3, -1>, // Near lower left corner < 6, 3, 1> // Far upper right corner texture { pigment {color Gray} } } //Dedo 1 object {dedo1 rotate delta*y translate 6*x } //Dedo 2 object {dedo2 rotate delta*y translate 6*x } //Dedo 3 object {dedo3 rotate delta*y translate 6*x } //Dedo 4 object {dedo4 rotate delta*y translate 6*x } //Dedo 5 object {dedo5 rotate delta*y translate 6*x } //Articulacao sphere{ <0,0,0>, 3 texture {pigment {color Pink}} } } #declare alfa = abs(180*clock - 90); #declare beta = abs(45*clock - 45); #declare gama = abs(180*clock - 90); #declare teta = -45*clock; #declare zeta = 60*clock; #declare punho = union { sphere{ <0,0,0>, 3 } cylinder { <0,0,0>, <6,0,0>, 3 } object { mao rotate alfa*y translate 6*x } texture {pigment {color Pink}} } #declare anteantebraco = union { sphere{ <0,0,0>, 3 } cylinder { <0,0,0>, <6,0,0>, 3 } object { punho rotate beta*x translate 6*x } texture {pigment {color Pink}} } #declare antebraco = union { sphere{ <0,0,0>, 3 } cylinder { <0,0,0>, <6,0,0>, 3 } object { anteantebraco rotate gama*z translate 6*x } texture {pigment {color Pink}} } #declare braco = union { sphere{ <0,0,0>, 3 } cylinder { <0,0,0>, <6,0,0>, 3 } object { antebraco rotate teta*z translate 6*x } texture {pigment {color Pink}} } #declare braco_justica = union{ sphere{ <0,0,0>, 3 } cylinder { <0,0,0>, <6,0,0>, 3 } object { braco rotate zeta*y translate 6*x } texture {pigment {color Pink}} } //Agora o objeto completo! object {braco_justica translate -25*x translate 10*z rotate 180*x }