// Last edited on 2023-12-25 12:35:58 by stolfi // Código do robo usado como base do aluno Pedro Lucas Lopes Rosa (RA: 248448) - ANIMACAO DE MINHA AUTORIA background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_robo = texture { pigment { color rgb <0.8, 0.8, 0.8> } // Adjust the color as needed finish { ambient 0.1 diffuse 0.5 specular 0.4 metallic 0.4 } } #macro robo(init, final, E11, E12, E13, E14, E15, D11, D12, D13, D14, D15, E21, E22, E23, E24, E25, D21, D22, D23, D24, D25) #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) } union { object { pescoco(final) } object { troncoInit texture{ tx_robo } } object { pernaEsquerda rotate E11*y translate init + <1.6, 0, +1> texture{ tx_robo } } object { pernaDireita rotate D11*y translate init - <1.6, 0, -1> texture{ tx_robo } } object { bracoEsquerdo rotate E21*y translate final + <1.6, 0, -1> texture{ tx_robo } } object { bracoDireito rotate D21*y translate final - <1.6, 0, 1> texture{ tx_robo } } } #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 E21*y translate <0, 0, 3> texture{ tx_robo } } } #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-20*x translate <0, 0, 4> texture{ tx_robo } } object { dedoObj rotate E24*y-20*x translate <0, 0, 4> texture{ tx_robo } } object { dedoObj rotate E25*y-20*x translate <0, 0, 4> texture{ tx_robo } } } #end #macro perna(E12, 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 E12*y translate <0, 0, 3> texture{ tx_robo } } } #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-20*x translate <0, 0, 4> texture{ tx_robo } } object { dedoObj rotate E14*y-20*x translate <0, 0, 4> texture{ tx_robo } } object { dedoObj rotate E15*y-20*x translate <0, 0, 4> texture{ tx_robo } } } #end #macro pescoco(init_pescoco) #local pescoco_aux = cylinder { <0, 0, 0>, <0, 0, 2>, 0.6 } union { object { pescoco_aux translate init_pescoco texture{ tx_robo } } object { cabeca() translate init_pescoco + <0, 0, 3> texture{ tx_robo } } } #end #macro cabeca() union { sphere { <0, 0, 0>, 2 texture{ tx_robo } } } #end #include "eixos.inc" // Código do robo usado como base do aluno Pedro Lucas Lopes Rosa (RA: 248448) - ANIMACAO DE MINHA AUTORIA #macro cena(clk) union{ #if (clk <= 0.5) #local E11 = 120; #local E12 = 45; #local D11= abs(80 * sin(2 * pi * clk)) - 120; #local D12= abs(45 * sin(2 * pi * clk)) - 45; #else #local E11 = - abs(80 * sin(2 * pi * clk)) + 120; #local E12 = - abs(45 * sin(2 * pi * clk)) + 45; #local D11= -120; #local D12= -45; #end #local E13= 50; #local E14= -10; #local E15= -50; #local D13= 45; #local D14= 90; #local D15= -45; #local E21= - abs(90 * sin(2 * pi * clk)) + 120; #local E22= - abs(60 * sin(2 * pi * clk)) + 45; #local E23=-45; #local E24=-90; #local E25=45; #local D21= abs(90 * sin(2 * pi * clk)) - 120; #local D22= abs(60 * sin(2 * pi * clk)) - 45; #local D23=-45; #local D24=-90; #local D25=45; #local init=<0,0,0>; #local final=<0,0,10>; robo(init, final, E11, E12, E13, E14, E15, D11, D12, D13, D14, D15, E21, E22, E23, E24, E25, D21, D22, D23, D24, D25) } #end // Código do robo usado como base do aluno Pedro Lucas Lopes Rosa (RA: 248448) - ANIMACAO DE MINHA AUTORIA object{ cena(clock) } // object{ eixos(20) } #include "camlight.inc" #declare centro_cena = < 0, 0, 5 >; #declare raio_cena = 18.0; #declare dir_camera = < 5, 7, 3 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)