// Last edited on 2010-12-15 22:37:15 by stolfilocal // Processed by remove-cam-lights #macro quadro(tt) background{ color rgb < 0.75, 0.80, 0.85 > } #declare raio = 2.000; #macro interpola(ta, va, tb, vb, tt) #local s = (tt-ta)/(tb-ta); ((1-s)*va + s*vb) #end #declare tx_vermelho = texture{ pigment{ color rgb < 1.00, 0.0, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_amarelo = texture{ pigment{ color rgb < 1.00, 1.0, 0.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #macro pe() union{ box{ < 0, 0, 0 > < -1, -1, -0.2 > texture { tx_amarelo } } } #end #macro anteperna(ang1) union{ object{ cylinder{ < 0, 0, 0 > < 0, 0, -2 > 0.35 texture { tx_vermelho } } } object{ pe() rotate ang1*y translate <0,0.35,-2>} } #end #macro coxa(ang1, ang2) union{ object{ anteperna(ang1) rotate ang2*y translate -1*z} object{ cylinder{ < 0, 0, 0 > < 0, 0, -1 > 0.35 texture { tx_vermelho } } } } #end #macro chassis(ang1, ang2, ang3) union{ object{coxa(ang1,ang2) rotate ang3*y translate <-2,-2,-1>} object{coxa(ang1,ang2) rotate ang3*y translate <2,2,-1>} object{coxa(ang1,ang2) rotate ang3*y translate <2,-2,-1>} object{coxa(ang1,ang2) rotate ang3*y translate <-2,2,-1>} object{ box{ < -2, -2, 0 > < 2, 2, -1 > texture { tx_amarelo } } } } #end #macro animal(ang1,ang2,ang3,trans) union{ object{ chassis(ang1, ang2, ang3) translate trans*z } } #end #macro armacao(faseArm) union{ #declare angCoxaFase = abs(40*sin(2*pi*faseArm)); #declare angAnteFase = -abs(80*sin(2*pi*faseArm)); #declare angPeFase = abs(40*sin(2*pi*faseArm)); #declare t0Arm = 0.000; #declare t2Arm = 0.500; #declare t4Arm = 0.100; #declare v0Arm = 0.0; #declare v2Arm = -2; #declare v4Arm = 0; #if((faseArm >= t0Arm) & (faseArm <= t2Arm)) #declare transArm = interpola(t0Arm, v0Arm ,t2Arm, v2Arm, faseArm); #else #declare transArm = interpola(t2Arm, v2Arm, t4Arm, v4Arm, faseArm); #end object{ animal(angCoxaFase,angAnteFase,angPeFase, transArm) } } #end #macro voo(h, faseVoo) union{ #declare t0Voo = 0.000; #declare t2Voo = 0.500; #declare t4Voo = 0.100; #declare v0Voo = 0.0; #declare v2Voo = h; #declare v4Voo = 0; #if((faseVoo >= t0Voo) & (faseVoo <= t2Voo)) #declare transVoo = interpola(t0Voo, v0Voo, t2Voo, v2Voo, faseVoo); #else #declare transVoo = interpola(t2Voo, v2Voo, t4Voo, v4Voo, faseVoo); #end object{ animal(0,0,0, transVoo) } } #end #macro voo_geral(h, p, q, fase) #local r = interpola(0,p,1,q,fase); object{ voo(h,fase) translate r } #end #macro armacao_geral(p, fase) object{armacao(fase) translate p } #end #macro quadroMeu(tt) union{ #local t0 = 0.000; #local t1 = 0.150; #local t2 = 0.500; #local t3 = 0.650; #local t4 = 1.000; #local A = <0,0,0>; #local B = <-4,0,4>; #local C = <0,4,0>; #if((tt>=t0) & (tt<=t1)) #local fase = interpola(t0,0,t1,1,tt); object{ armacao_geral(A, fase) } #end #if((tt>=t1) & (tt<=t2)) #local fase = interpola(t1,0,t2,1,tt); object{ voo_geral(6, A, B fase) } #end #if((tt>=t2) & (tt<=t3)) #local fase = interpola(t2,0,t3,1,tt); object{ armacao_geral(B, fase) } #end #if((tt>=t3) & (tt<=t4)) #local fase = interpola(t3,0,t4,1,tt); object{ voo_geral(6, B, C, fase) } #end } #end #include "eixos.inc" union{ object{ eixos(3.00) } quadroMeu(tt) scale 0.5 } #end //fim da macro quadro(clock) // Original camera parameters: // #local cam_ctr = <0,0,0> // #local cam_loc = <4.00,8.00,2.00> // #local cam_vec = <4.00,8.00,2.00> // #local cam_sky = z #include "camlight.inc" camlight(<0,0,0>,5.041,<10,10,10>,9.165,z,1.2)