// Last edited on 2023-12-24 08:45:11 by stolfi background{ color rgb < 0.8, 0.8, 0.9 > } // ====================================================================== // CORES E TEXTURAS #declare tx_plastico_marrom_claro = texture { pigment { color rgb < 0.70, 0.65, 0.40 > } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_marrom_escuro = texture { pigment { color rgb < 0.40, 0.30, 0.20 > } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // PARTES #macro mao(b5) union { sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } cylinder { <0, 0, 0>, <3, 0, 0>, 1 rotate <0, b5, 0> texture { tx_plastico_marrom_claro } } cylinder { <0, 0, 0>, <3, 0, 0>, 1 rotate <0, b5, 60> texture { tx_plastico_marrom_claro } } cylinder { <0, 0, 0>, <3, 0, 0>, 1 rotate <0, b5, -60> texture { tx_plastico_marrom_claro } } } #end #macro cotovelo(b4, b5) union { object{ mao(b5) translate <5, 0, 0> rotate <0, b4, 0> } cylinder { <0, 0, 0>, <5, 0, 0>, 1 rotate <0, b4, 0> texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro membro(b1, b2, b3, b4, b5) union { object{ cotovelo(b4, b5) translate<5, 0, 0> rotate } cylinder { <0, 0, 0>, <5, 0, 0>, 1 rotate texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro cabeca(a5, a6) union { difference { box { <-0.75, -0.75, 0.5>, <0.75, 0.75, 2> texture { tx_plastico_marrom_claro } } cylinder { <0, 0.76, 1.25>, <0, 0.5, 1.25>, 0.5 texture { tx_plastico_marrom_claro } } } cylinder { <0, 0, 0.5>, <0, 0, 0>, 3 texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } rotate } #end #macro vertebra(a4, a5, a6) union { object{ cabeca(a5, a6) translate<0, 0, 5> rotate } cylinder { <0, 0, 0>, <0, 0, 5>, 1 rotate texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro pescoco(a1, a2, a3, a4, a5, a6) union { object{ vertebra(a4, a5, a6) translate<0, 0, 5> rotate } cylinder { <0, 0, 0>, <0, 0, 5>, 1 rotate texture { tx_plastico_marrom_claro } } sphere { <0, 0, 0>, 1 texture { tx_plastico_marrom_escuro } } } #end #macro robo(a1, a2, a3, a4, a5, a6, b11, b12, b13, b14, b15, b21, b22, b23, b24, b25, b31, b32, b33, b34, b35, b41, b42, b43, b44, b45) union { box { <-2.5, -2.5, -5>, <2.5, 2.5, 5> texture {tx_plastico_marrom_claro} } object { pescoco(a1, a2, a3, a4, a5, a6) translate<0, 0, 5> } object { membro(b11, b12, b13, b14, b15) translate<2.5, 0, 4> } object { membro(b21, b22, b23, b24, b25) translate<2.5, 0, 4> scale <-1, 1, 1> } object { membro(b31, b32, b33, b34, b35) translate<2.5, 0, -4> } object { membro(b41, b42, b43, b44, b45) translate<2.5, 0, -4> scale <-1, 1, 1>} } #end #declare DX = 10; #declare DY = 9; #declare DZ = 20; object { robo(15, 30, 10, -60, 30, -45, 90, -20, 45, 45, 30, 0, -20, 0, 45, 60, 90, 90, 0, 0, 60, 0, 0, 0, 0, 0) translate -DX*x } object { robo(15, -30, 10, +30, 30, -45, 90, -20, 15, 45, 30, 90, -20, 0, 75, 60, 90, 30, 0, 0, 60, 0, 30, 0, 0, -60) translate +DX*x } #declare cmin = < -2*DX, -DY, -DZ >; #declare cmax = < +2*DX, +DY, +DZ >; #include "gaiola.inc" // object{ gaiola(cmin,cmax) } #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmax-cmin); #declare dist_camera = 7*raio_cena; #include "camlight.inc" #declare dir_camera = < 5, 7, 3 >; #declare intens_luz = 1.2; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)