background{ color rgb < 0.8, 0.8, 0.9 > } // ====================================================================== // CORES E TEXTURAS #declare tx_plastico_marrom_claro = texture { pigment { color rgb < 0.5, 0.4, 0.3 > } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_marrom_escuro = texture { pigment { color rgb < 0.4, 0.3, 0.2 > } 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 // ====================================================================== // CONSTRUINDO // TESTES // object {membro(45, 60, 30, 45, 0)} // object {pescoco(45, 60, 30, -15, 30, -45)} // FINAL // union { // box { // <-2.5, -2.5, -5>, <2.5, 2.5, 5> // texture {tx_plastico_marrom_claro} // } // object { pescoco(15, 30, 10, -60, 30, -45) translate<0, 0, 5> } // object { membro(90, -20, 45, 45, 30) translate<2.5, 0, 4> } // object { membro(0, -20, 0, 45, 60) translate<2.5, 0, 4> scale <-1, 1, 1> } // object { membro(90, 90, 0, 0, 60) translate<2.5, 0, -4> } // object { membro(0, 0, 0, 0, 0) translate<2.5, 0, -4> scale <-1, 1, 1>} // } 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) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 25.0; #declare dir_camera = < 1, 1, 1 >; #declare dist_camera = 5 * raio_cena; #declare intens_luz = 1.2; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)