// Last edited on 2009-10-11 20:06:30 by stolfilocal // Processed by remove-cam-lights #macro quadro(tt) background{ color rgb < 0.75, 0.80, 0.85 > } #declare tinta_A = texture { pigment { color rgb < 0.55, 0.80, 0.55> } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #macro galinha(aPescoco1, aPescoco2, aPescoco3, aPerna1_1, aPerna1_2, aPerna1_3, aPerna2_1, aPerna2_2, aPerna2_3, aPerna3_1, aPerna3_2, aPerna3_3, aPerna4_1, aPerna4_2, aPerna4_3, aPerna5_1, aPerna5_2, aPerna5_3, aPerna6_1, aPerna6_2, aPerna6_3, aAsa1_1, aAsa1_2, aAsa1_3, aAsa1_x, aAsa2_1, aAsa2_2, aAsa2_3, aAsa2_x) union { cylinder {<0,0,0>, <6.5,0,0>, 1} sphere {<0,0,0>, 1} sphere {<6.5,0,0>, 1} object { cabeca1(aPescoco2, aPescoco3) rotate aPescoco1*y translate 0.5*<-1.414213562, 0, 1.414213562> } object { perna1(aPerna1_2, aPerna1_3) rotate aPerna1_1*y translate 0.5*<0.5, -1.414213562, -1.414213562> } object { perna1(aPerna2_2, aPerna2_3) rotate aPerna2_1*y translate 0.5*<0.5, 1.414213562, -1.414213562> } object { perna1(aPerna3_2, aPerna3_3) rotate aPerna3_1*y translate 0.5*<6.0, -1.414213562, -1.414213562> } object { perna1(aPerna4_2, aPerna4_3) rotate aPerna4_1*y translate 0.5*<6.0, 1.414213562, -1.414213562> } object { perna1(aPerna5_2, aPerna5_3) rotate aPerna5_1*y translate 0.5*<11.5, -1.414213562, -1.414213562> } object { perna1(aPerna6_2, aPerna6_3) rotate aPerna6_1*y translate 0.5*<11.5, 1.414213562, -1.414213562> } object { asa1(aAsa1_2, aAsa1_3) rotate aAsa1_1*y rotate aAsa1_x*x translate 0.5*<1.5, -1.414213562, 1.414213562> } object { asa1(aAsa2_2, aAsa2_3) rotate aAsa2_1*y rotate aAsa2_x*x translate 0.5*<1.5, 1.414213562, 1.414213562> } } #end #macro cabeca1 (aPescoco2, aPescoco3) union { sphere {<0,0,0>, 0.25} cylinder {<0,0,0>, <0,0,1>, 0.2} object { cabeca2(aPescoco3) rotate aPescoco2*y translate <0,0,1> } } #end #macro cabeca2 (aPescoco3) union { sphere {<0,0,0>, 0.25} cylinder {<0,0,0>, <0,0,1>, 0.15} object { cabeca() rotate aPescoco3*y translate <0,0,1> } } #end #macro cabeca() union { sphere {<0,0,0>, 0.2} sphere {<0,0,0.4>, 0.4} cone { <0, 0, 0.4>, 0.2 <-0.8, 0, 0.4>, 0 } } #end #macro perna1(aPerna1_2, aPerna1_3) union { sphere {<0,0,0>, 0.3} cylinder {<0,0,0>, <0,0,-1>, 0.25} object { perna2(aPerna1_3) rotate aPerna1_2*y translate <0,0,-1> } } #end #macro perna2(aPerna1_3) union { sphere {<0,0,0>, 0.3} cylinder {<0,0,0>, <0,0,-1>, 0.25} object { pe() rotate aPerna1_3*y translate <0,0,-1> } } #end #macro pe() union { sphere {<0,0,0>, 0.3} box {<-0.7, -0.4, -0.3>, <0.3, 0.4, 0.0>} } #end #macro asa1(aAsa1_2, aAsa1_3) union { sphere {<0,0,0>, 0.1} cylinder {<0,0,0>, <0,0,0.75>, 0.085} object { asa2(aAsa1_3) rotate aAsa1_2*y translate <0,0,0.75> } } #end #macro asa2(aAsa1_3) union { sphere {<0,0,0>, 0.1} cylinder {<0,0,0>, <0,0,1.5>, 0.085} object { pontaAsa() rotate aAsa1_3*y translate <0,0,1.5> } } #end #macro pontaAsa() union { sphere {<0,0,0>, 0.1} cone { <0,0,0>, 0.085, <0,0,1.5>, 0.0 } } #end #macro interpola(x0, x1, rr) (1-rr)*x0 + rr*x1 #end #macro interpola_perna(a, b, c, a0, b0, c0, a1, b1, c1, tt, t0, t1) #local r = (tt-t0) / (t1-t0); #declare a = interpola(a0, a1, r); #declare b = interpola(b0, b1, r); #declare c = interpola(c0, c1, r); #end #macro define_algulo_perna(a, b, c, tt) #local tn = tt - floor(tt); #local a0 = -15.0; #local a1 = +05.0; #local a2 = +25.0; #local a3 = +25.0; #local a4 = +05.0; #local a5 = -15.0; #local b0 = -10.0; #local b1 = -45.0; #local b2 = -90.0; #local b3 = -05.0; #local b4 = -10.0; #local b5 = -10.0; #local c0 = 15.0; #local c1 = 30.0; #local c2 = 60.0; #local c3 = 0.0; #local c4 = 10.0; #local c5 = 15.0; #if (tn < 0.2) interpola_perna(a, b, c, a0, b0, c0, a1, b1, c1, tn, 0.0, 0.2) #end #if ((tn >= 0.2) & (tn < 0.4)) interpola_perna(a, b, c, a1, b1, c1, a2, b2, c2, tn, 0.2, 0.4) #end #if ((tn >= 0.4) & (tn < 0.6)) interpola_perna(a, b, c, a2, b2, c2, a3, b3, c3, tn, 0.4, 0.6) #end #if ((tn >= 0.6) & (tn < 0.8)) interpola_perna(a, b, c, a3, b3, c3, a4, b4, c4, tn, 0.6, 0.8) #end #if ((tn >= 0.8) & (tn <= 1.0)) interpola_perna(a, b, c, a4, b4, c4, a5, b5, c5, tn, 0.8, 1.0) #end #end #macro galinha_andando(tempo) #local t0 = 0.0; #local t1 = 0.2; #local t2 = 0.4; #local t3 = 0.6; #local t4 = 0.8; #local t5 = 1.0; #local aAsa1_1 = 30; #local aAsa2_1 = 30; #local aAsa1_2 = -60; #local aAsa2_2 = -60; #local aAsa1_3 = 30; #local aAsa2_3 = 30; #local aAsa1_x = +60; #local aAsa2_x = -60; #local aPerna1_1 = 0; #local aPerna1_2 = 0; #local aPerna1_3 = 0; define_algulo_perna(aPerna1_1, aPerna1_2, aPerna1_3, tempo) #local aPerna2_1 = 0; #local aPerna2_2 = 0; #local aPerna2_3 = 0; define_algulo_perna(aPerna2_1, aPerna2_2, aPerna2_3, tempo+0.5) #local aPerna3_1 = 0; #local aPerna3_2 = 0; #local aPerna3_3 = 0; define_algulo_perna(aPerna3_1, aPerna3_2, aPerna3_3, tempo+0.5) #local aPerna4_1 = 0; #local aPerna4_2 = 0; #local aPerna4_3 = 0; define_algulo_perna(aPerna4_1, aPerna4_2, aPerna4_3, tempo) #local aPerna5_1 = 0; #local aPerna5_2 = 0; #local aPerna5_3 = 0; define_algulo_perna(aPerna5_1, aPerna5_2, aPerna5_3, tempo) #local aPerna6_1 = 0; #local aPerna6_2 = 0; #local aPerna6_3 = 0; define_algulo_perna(aPerna6_1, aPerna6_2, aPerna6_3, tempo+0.5) galinha(-15,30,-45, aPerna1_1, aPerna1_2, aPerna1_3, aPerna2_1, aPerna2_2, aPerna2_3, aPerna3_1, aPerna3_2, aPerna3_3, aPerna4_1, aPerna4_2, aPerna4_3, aPerna5_1, aPerna5_2, aPerna5_3, aPerna6_1, aPerna6_2, aPerna6_3, aAsa1_1,aAsa1_2,aAsa1_3,aAsa1_x, aAsa2_1,aAsa2_2,aAsa2_3,aAsa2_x) #end object { galinha_andando(tt) texture {tx_fosca} rotate 180*z } object { plane {<0,0,1>, -3} texture {tinta_A} } #end quadro(clock) // Original camera parameters: // #local cam_ctr = <0,0,0> // #local cam_vec = <-15.0,-15.0,0.0> // #local cam_sky = z #include "camlight.inc" camlight(<-1,0,0>,6.5,<10,10,4>,30.0,z,1.2)