// Last edited on 2023-12-25 13:41:51 by stolfi background{ color rgb < 0.80, 0.90, 0.85 > } #declare tx_bug = texture{ pigment{ color rgb < 1.000, 0.400, 0.000 > } finish{ diffuse 0.7 ambient 0.3 } } #macro pata() object { box { < 0, -1, -0.2 >, < 2, 1, 0.2 > } } #end #macro submembro(b4) #local objeto = cylinder { < 0, 0, 0 >, < 0, 0, -5 >, 1 } #local subobjeto = object { pata() } union { object { objeto } object { subobjeto rotate b4*y translate < 0, 0, -5 > } } #end #macro membro(b3, b4) #local objeto = cylinder { < 0, 0, 0 >, < 0, 0, -5 >, 1 } #local subobjeto = object { submembro(b4) } union { object { objeto } object { subobjeto rotate b3*y translate < 0, 0, -5 > } } #end // b11 a b14: perna esquerda // b21 a b24: perna direita // b31 a b34: braco esquerdo // b41 a b44: braco direito #macro robo(b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34, b41, b42, b43, b44) #local objeto = cylinder { < 0, 0, 10 >, < 0, 0, 0 >, 5 } #local perna_esquerda = object { membro(b13, b14) } #local perna_direita = object { membro(b23, b24) } #local braco_esquerdo = object { membro(b33, b34) rotate 90*x translate < 0, 0, 8>} #local braco_direito = object { membro(b43, b44) rotate -90*x translate < 0, 0, 8>} union { object { objeto } object { perna_esquerda rotate b11*y rotate b12*z translate < 0, 3, 0 > } object { perna_direita //scale < +1, -1, +1 > rotate b21*y rotate b22*z translate < 0, -3, 0 > } object { braco_esquerdo rotate -b31*z rotate b32*y translate < 0, 3, 0 > } object { braco_direito //scale < +1, -1, +1 > rotate b41*z rotate b42*y translate < 0, -3, 0 > } texture{ tx_bug } } #end #macro cena(tt) #local intervalo = 0.125; #if (tt < intervalo) #local f = tt/intervalo; robo(0, 0, 25*f, 0, 0, 0, 25*f, 0, 25*f, 0, 0, 0, 25*f, 0, 0, 0) #end #if (tt >= intervalo & tt < 2*intervalo) #local f = (tt-intervalo)/intervalo; robo(25*f, 0, 25+20*f, 45*f, 0, 0, 25+20*f, 45*f, 25+20*f, 15*f, 0, 0, 25+20*f, 15*f, 0, 0) #end #if (tt >= 2*intervalo & tt < 3*intervalo) #local f = (tt-2*intervalo)/intervalo; robo(25+20*f, 0, 45, 45, 0, 0, 45, 45, 45, 15, 0, 0, 45, 15, 0, 0) #end #if (tt >= 3*intervalo & tt < 4*intervalo) #local f = (tt-3*intervalo)/intervalo; robo(45, 0, 45, 45-22.5*f, 22.5*f, 0, 45, 45, 45, 15, 0, 0, 45, 15+15*f, 0, 0) #end #if (tt >= 4*intervalo & tt < 5*intervalo) #local f = (tt-4*intervalo)/intervalo; robo(45, 0, 45, 22.5-22.5*f, 22.5+22.5*f, 0, 45, 45-45*f, 45-45*f, 15-15*f, 45*f, 0, 45-45*f, 30-30*f, 45*f, 0) #end #if (tt >= 5*intervalo & tt < 6*intervalo) #local f = (tt-5*intervalo)/intervalo; robo(25-25*f, 0, 45-22.5*f, 45-45*f, 0, 0, 45-22.5*f, 45-45*f, 45-20*f, 15-15*f, 0, 0, 45-20*f, 15-15*f, 0, 0) #end #if (tt >= 6*intervalo & tt < 7*intervalo) #local f = (tt-6*intervalo)/intervalo; robo(0, 0, 25-25*f, 0, 0, 0, 25-25*f, 0, 25-25*f, 0, 0, 0, 25-25*f, 0, 0, 0) #end #if (tt >= 7*intervalo & tt <= 8*intervalo) // Prof. robo( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) #end #end object { cena(clock) } #include "eixos.inc" // object{ eixos(20.0) } #include "camlight.inc" #declare centro_cena = < 3, 0, 5 >; #declare raio_cena = 20.0; #declare dir_camera = < 7, 5, 3 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)