// Last edited on DATE TIME by stolfi // Vitor Sexto Bernardes - RA 010063 // ====================================================================== #declare ctr = < 0, 0, 2 >; #declare camDir = < 0, 40, 10 >; camera { location ctr + 0.65*camDir right -1.00*x up 0.75*y sky z look_at ctr } // ====================================================================== // FONTES DE LUZ light_source { < 0, 20, 50 > // Posição da lâmpada. color rgb 0.4 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0, -25, 9 > // Posição da lâmpada. color rgb 2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0, 90, 20 > // Posição da lâmpada. color rgb 0.5 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA #declare tx_corpo = texture { pigment { color rgb <0.8, 0.9, 0.2> } } #declare tx_perna = texture { pigment { color rgb <0.5, 0.3, 0> } } #declare chao = plane { <0, 0, -1>, 1 pigment { granite scale <11, 11, 11> } finish { ambient 0.1 specular .25 reflection .2 } } #declare raio_corpo = 3; #declare corpo = union { intersection { sphere { <0,0,0>, raio_corpo scale <1,1,0.6> } sphere { <0,0,3>, 4.5 scale <1,1,0.6> } texture { tx_corpo } finish { phong .5 } } } #declare art4 = union { cylinder { <0, 0, 0>, <0, 0, -2>, 0.4 rotate 90*y } sphere { <0,0,0>, 0.4 } texture { tx_perna } } #macro art3(delta) union { cylinder { <0, 0, 0>, <0, 0, -3>, 0.4 texture { tx_perna } } sphere { <0,0,0>, 0.4 texture { tx_perna } } object { art4 rotate delta*z translate <0, 0, -3> } } #end #macro art2(gama, delta) union { cylinder { <0, 0, 0>, <0, 0, -3>, 0.4 texture { tx_perna } } sphere { <0, 0, 0>, 0.4 texture { tx_perna } } object { art3(delta) rotate gama*x translate <0, 0, -3> } } #end #macro art1(beta, gama, delta) union { cylinder { <0, 0, 0>, <0, 0, -2>, 0.4 texture { tx_perna } } sphere { <0, 0, 0>, 0.4 texture { tx_perna } } object { art2(gama, delta) rotate beta*y translate <0, 0, -2> } } #end // ====================================================================== // CENA FINAL #declare altura = 6; object { chao } object { corpo translate <0, 0, altura>} #declare fonte = seed (7); #declare i=pi/6; // contador dos braços #while (i<=2*pi) #declare alfa = -45 + 90*rand(fonte); #declare beta = -60 * rand(fonte); #declare gama = 60 * rand(fonte); #declare delta = 90 * rand(fonte); object { art1(beta, gama, delta) rotate degrees(i)*z rotate alfa*y translate // dando a volta no corpo } #declare i=i+pi/3; #end