// Last edited on 2023-12-25 13:07:10 by stolfi background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_tanque_grande = texture{ pigment{ color rgb < 0.41, 0.41, 0.41 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #macro robo(E11, E12, E13, E14, E15, D11, D12, D13, D14, D15, E21, E22, E23, E24, E25, D21, D22, D23, D24, D25, M1) #local init = <0, 0, 0>; #local final = <0, 10, 5>; #local troncoInit = cylinder { init, final, 2 } #local pernaEsquerda = object { perna(E12, E13, E14, E15) } #local pernaDireita = object { perna(D12, D13, D14, D15) } #local bracoEsquerdo = object { braco(E22, E23, E24, E25) } #local bracoDireito = object { braco(D22, D23, D24, D25) } #local pescocoObj = object { pescoco(M1) } union { object { troncoInit texture{ tx_tanque_grande } } object { pescocoObj rotate M1*y translate final texture{ tx_tanque_grande } } object { pernaEsquerda rotate E11*x translate init + <1.6, 0, 0> texture{ tx_tanque_grande } } object { pernaDireita rotate D11*x translate init - <1.6, 0, 0> texture{ tx_tanque_grande } } object { bracoEsquerdo rotate E21*x translate final + <1.6, 0, 0> texture{ tx_tanque_grande } } object { bracoDireito rotate D21*x translate final - <1.6, 0, 0> texture{ tx_tanque_grande } } } #end #macro braco(E21, E23, E24, E25) #local subbracoObj = object { subbraco(E23, E24, E25) } #local bracoObj = cylinder { <0, 0, 0>, <0, 0, 3>, 0.4 } union { object { bracoObj } object { subbracoObj rotate E12*y translate <0, 0, 3> texture{ tx_tanque_grande } } } #end #macro subbraco(E23, E24, E25) #local dedoObj = cylinder { <0, 0, 0>, <0, 0, 2>, 0.2 } #local subbracoObj = cylinder { <0, 0, 0>, <0, 0, 4>, 0.4 } union { object { subbracoObj } object { dedoObj rotate E23*y translate <0, 0, 4> texture{ tx_tanque_grande } } object { dedoObj rotate E24*y translate <0, 0, 4> texture{ tx_tanque_grande } } object { dedoObj rotate E25*y translate <0, 0, 4> texture{ tx_tanque_grande } } } #end #macro perna(aa, E13, E14, E15) #local subpernaObj = object { subperna(E13, E14, E15) } #local pernaObj = cylinder { <0, 0, 0>, <0, 0, 3>, 0.4 } union { object { pernaObj } object { subpernaObj rotate aa*y translate <0, 0, 3> texture{ tx_tanque_grande } } } #end #macro subperna(E13, E14, E15) #local dedoObj = cylinder { <0, 0, 0>, <0, 0, 2>, 0.2 } #local subpernaObj = cylinder { <0, 0, 0>, <0, 0, 4>, 0.4 } union { object { subpernaObj } object { dedoObj rotate E13*y translate <0, 0, 4> texture{ tx_tanque_grande } } object { dedoObj rotate E14*y translate <0, 0, 4> texture{ tx_tanque_grande } } object { dedoObj rotate E15*y translate <0, 0, 4> texture{ tx_tanque_grande } } } #end #macro pescoco(M1) #local objCabeca = sphere { <0, 0, 0>, 2 } #local objPescoco = cylinder { <0, 0, 0>, <0, 4, 2>, 0.4 } union { object { objPescoco } object { objCabeca rotate M1*y translate <0, 4, 2> texture{ tx_tanque_grande } } } #end #macro cena(tt) #local E11 = 200 - 200*tt; #local E12 = 45*tt; #local E13= -45; #local E14= -90; #local E15= 45; #local D11= -200 + 200*tt; #local D12= -45*tt; #local D13= 45; #local D14= 90; #local D15= -45; #local E21= 200 - 200*tt; #local E22= 165 - 165*tt; #local E23=-45; #local E24=-90; #local E25=45; #local D21=-200 + 200*tt; #local D22=165 - 165*tt; #local D23=-45; #local D24=-90; #local D25=45; #local M1 = 0*tt; #if (200*tt >= 180) #local D11= D11; #local E21= E21; #local E22= E22; #local D21=-D21; #local D22=D22; #else #if (200*tt >= 135) #local D11= D11 + (45 - 200*tt); #local E21= E21 + (45 - 200*tt); #local E22= E22 + (45 - 165*tt); #local D21=-D21 + (45 - 200*tt); #local D22=D22 + (45 - 165*tt); #else #if (200*tt >= 90) #local D11= D11; #local E21= E21; #local E22= E22; #local D21=-D21; #local D22=D22; #else #if (200*tt >= 45) #local D11= D11 + (45 - 200*tt); #local E21= E21 + (45 - 200*tt); #local E22= E22 + (45 - 165*tt); #local D21=-D21 + (45 - 200*tt); #local D22=D22 + (45 - 165*tt); #end #end #end #end union{ robo(E11, E12, E13, E14, E15, D11, D12, D13, D14, D15, E21, E22, E23, E24, E25, D21, D22, D23, D24, D25, M1) } #end #include "eixos.inc" // object{ eixos(20) } object { cena(clock) } #include "camlight.inc" #declare centro_cena = < 0, 4, 3 >; #declare raio_cena = 20.0; #declare dir_camera = < 7, 5, 3 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)