// Textures background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_robo = texture{ pigment{ color rgb < 0.25, 0.16, 0.16 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_membros = texture{ pigment{ color rgb < 0.10, 0.25, 0.16 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_submembros = texture{ pigment{ color rgb < 0.15, 0.15, 0.35 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_pata = texture{ pigment{ color rgb < 0.3, 0.3, 0.3 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_cabeca = texture{ pigment{ color rgb < 0.8, 0.2, 0.4 > } finish{ diffuse 0.9 ambient 0.1 } } // Objetos #declare chao = box{ <-100,-100,-1>, <+100,+100,0> } // Macros #macro dedos_mao(origem) union{ cylinder { origem, origem + <0, 2, 0>, 0.5 } cylinder { origem, origem + <1, 2, 0>, 0.5 } cylinder { origem, origem + <-1, 2, 0>, 0.5 } } #end #macro pata(origem) union{ sphere { origem + <0, 1, 0>, 1 } dedos_mao(origem+<0, 2, 0>) } #end #macro antebraco(origem, ang_3) union { cylinder { origem, origem + <0, 3, 0>, 1 texture {tx_submembros} } object{ pata(<0, 0, 0>) rotate<0, 0, ang_3> translate origem+<0, 3, 0> // se a origem do antebraco = `origem`, entao origem da mao sera origem + 3 (fim do antebraco) texture {tx_pata} } } #end #macro braco(origem, ang_2, ang_3) union { cylinder { origem, origem + <0, 4, 0>, 1 texture {tx_membros} } object { antebraco(<0, 0, 0>, ang_3) rotate translate origem + <0, 4, 0> } } #end #macro cabeca(origem) union { sphere { origem + <0, 0, 2.5>, 2.5 } sphere { origem + <2.5, 0, 2.5>, 0.5 } } #end #macro subpescoco(origem, ang_3, ang_4) union { cylinder { origem, origem + <0, 0, 1>, 1.5 texture {tx_submembros} } object{ cabeca(<0, 0, 0>) rotate translate origem+<0, 0, 1> texture {tx_cabeca} } } #end #macro pescoco(origem, ang_2, ang_3, ang_4) union { cylinder { origem, origem + <0, 0, 1>, 1.5 texture {tx_membros} } object { subpescoco(<0, 0, 0>, ang_3, ang_4) rotate translate origem + <0, 0, 1> } } #end #macro robo(E11, E12, E13, E14, D11, D12, D13, D14, E21, E22, E23, E24, D21, D22, D23, D24, P1, P2, P3, P4) union { cylinder { <0, 0, 0>, <0, 0, 16>, 3 texture {tx_robo} } object { braco(<0, 0, 0>, E13, E14) rotate translate<0, 3, 14> } object { braco(<0, 0, 0>, D13, D14) rotate translate<0, 3, 14> scale <1, -1, 1> } object { braco(<0, 0, 0>, E23, E24) rotate translate<0, 3, 0> } object { braco(<0, 0, 0>, D23, D24) rotate translate<0, 3, 0> scale <1, -1, 1> } object{ pescoco(<0, 0, 0>, P2, P3, P4) rotate<0, P1, 0> translate<0, 0, 16> } } #end #include "eixos.inc" // Cena union{ object{ eixos(10.00) } object { robo(-45, -45, 45, 45, -45, -45, 45, 45, 0, -60, 0, 0, 0, -60, 0, 0, 0, 0, 30, 0) rotate<0, 0, 45> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 40.0; #declare dir_camera = < 9.00, 7.00, 3.00 >; #declare dist_camera = 8*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)