// Last edited on 2023-12-23 22:43:21 by stolfi // Textures background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_robo = texture{ pigment{ color rgb 2.0*< 0.25, 0.16, 0.16 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_membros = texture{ pigment{ color rgb 2.0*< 0.10, 0.25, 0.16 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_submembros = texture{ pigment{ color rgb 2.0*< 0.15, 0.15, 0.35 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_pata = texture{ pigment{ color rgb 2.0*< 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 #declare DX = 13; #declare DY = 13; #declare DZ = 15; union{ // object{ eixos(10.00) } object { robo(-45, -45, 45, 45, -45, -45, 45, 45, 0, -60, 0, 0, 0, -60, 0, 0, 20, 40, 30, 0) } object { robo(-15, -75, 25, 65, -15, -55, 25, -75, -30, -30, -30, -30, 20, -30, -70, -10, -20, -40, 10, -50) translate 2*DY*y } } #declare cmin = < -DX, -DY, -0.5*DZ >; #declare cmax = < +DX, +3*DY, +1.8*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 = < 9.00, 7.00, 3.00 >; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)