// Last edited on 2009-10-11 19:58:31 by stolfilocal // Processed by remove-cam-lights #macro quadro(tt) background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_madeira = texture{ pigment{ color rgb < 1, 0, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_ferro = texture{ pigment{ color rgb < 0.6, 0.6, 0.6 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 reflection 0.1*< 0.6, 0.6, 0.6 > } } #declare tx_plastico = texture{ pigment{ color rgb < 1,1,1 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 reflection 0.1*< 0.6, 0.6, 0.6 > } } #declare tx_fosca = texture{ pigment{ color rgb < 0.92,0.8,0.51 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.97, 0.98, 1.00 > filter 0.20 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #macro galinha( a1, a2, a31, a41, a51, a32, a42, a52, a61, a71, a81, a62, a72, a82, a63, a73, a83, a64, a74, a84, a65, a75, a85, a66, a76, a86 ) union { sphere { < 0,0,0 >, 2 scale < 0,0.3,0.3 > texture{ tx_fosca } } object{ pescoco( a1,a2 ) translate < -0.9,0.2,0 > } object{ asa( a31,a41,a51 ) translate < -0.5,0.3,0.6 > } object{ asa( a32,a42,a51 ) translate < -0.5,0.3,0.6 > scale < 1,1,-1 > } object{ perna( a61,a71,a81 ) translate < -1,-0.3,0.3 > } object{ perna( a62,a72,a82 ) translate < -1,-0.3,0.3 > scale < 1,1,-1 > } object{ perna( a63,a73,a83 ) translate < 0,-0.3,0.4 > } object{ perna( a64,a74,a84 ) translate < 0,-0.3,0.4 > scale < 1,1,-1 > } object{ perna( a65,a75,a85 ) translate < 1,-0.3,0.3 > } object{ perna( a66,a76,a86 ) translate < 1,-0.3,0.3 > scale < 1,1,-1 > } } #end #macro pescoco( a_pesco, a_cabe ) union { cylinder { < 0,0,0 >, < 0,2,0 >, 0.1 texture{ tx_fosca } } sphere { < 0,0,0 >, 0.1 texture{ tx_fosca } } object { cabeca( a_cabe ) translate < 0,1.9,0 > } } rotate a_pesco*z #end #macro cabeca( a_cabe ) union { sphere { < 0,0,0 >, 0.3 texture{ tx_fosca } } cone { < 0,0,0 > 0.1, < -0.15,0,0 > 0 translate < -0.29,0,0 > } } rotate a_cabe*y #end #macro asa( a_asa, a_asa_s, a_asa_s_s ) union { box { < 0,0,0 >, < 1.3,-0.6,0.01 > texture{ tx_fosca } } object { asa_sub( a_asa_s, a_asa_s_s ) translate < 1.3,-0.6,0 > } } rotate a_asa*z rotate -a_asa*x #end #macro asa_sub( a_asa_s, a_asa_s_s ) union { box { < 0,0,0 >, < -0.8,-0.3,0.01 > texture{ tx_fosca } } object { asa_sub_sub( a_asa_s_s ) translate < -0.8,-0.3,0 >} } rotate a_asa_s*z #end #macro asa_sub_sub( a_asa_s_s ) union { box { < 0,0,0 >, < 0.4,-0.2,0.01 > texture{ tx_fosca } } } rotate -a_asa_s_s*z #end #macro perna( a_coxa, a_canela, a_pe ) union { cylinder { < 0,0,0 >, < 0,-1,0 >, 0.1 texture{ tx_fosca } } object { perna_sub( a_canela, a_pe ) translate < 0,-1,0 > } } rotate a_coxa*z #end #macro perna_sub( a_canela, a_pe ) union { cylinder { < 0,0,0 >, < 0,-0.7,0 >, 0.1 texture{ tx_fosca } } object { perna_sub_sub( a_pe ) translate < 0,-0.7,0 > } } rotate a_canela*z #end #macro perna_sub_sub( a_pe ) union { box { < 0,0,0 >, < 0.8,-0.08,0.2 > texture{ tx_fosca } translate < -0.5,0,0 > } } rotate a_pe*z #end #macro define_angulo_perna(a, b, c, te) #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 a11 = 15; #local a21 = -40; #local a31 = -50; #local a12 = 30; #local a22 = 80; #local a32 = 50; #local a13 = -45; #local a23 = -40; #local a33 = 0; #local a41 = -40; #local a51 = -20; #local a61 = 15; #local a42 = 60; #local a52 = 60; #local a62 = 30; #local a43 = -20; #local a53 = -20; #local a63 = -45; #if ((te >= t0) & (te < t1)) interpola_perna(a, b, c, a11, a12, a13, a21, a22, a23, te, t0, t1) #end #if ((te >= t1) & (te < t2)) interpola_perna(a, b, c, a21, a22, a23, a31, a32, a33, te, t1, t2) #end #if ((te >= t2) & (te < t3)) interpola_perna(a, b, c, a31, a32, a33, a41, a42, a43, te, t2, t3) #end #if ((te >= t3) & (te < t4)) interpola_perna(a, b, c, a41, a42, a43, a51, a52, a53, te, t3, t4) #end #if ((te >= t4) & (te <= t5)) interpola_perna(a, b, c, a51, a52, a53, a61, a62, a63, te, t4, t5) #end #end #macro interpola_perna(a, b, c, a0, b0, c0, a1, b1, c1, tt, t0, t1) #local rr = (tt-t0)/(t1-t0); #declare a = interpola(a0, a1, rr); #declare b = interpola(b0, b1, rr); #declare c = interpola(c0, c1, rr); #end #macro interpola(x0, x1, rr) (1-rr)*x0 + rr*x1 #end #macro galinha_andando(tt) #local a1 = 30; #local a2 = 20+10*tt; #local a31 = 30; #local a41 = 30; #local a51 = 30; #local a32 = 45; #local a42 = 30; #local a52 = 35; #declare aE1 = 0; #declare bE1 = 0; #declare cE1 = 0; #declare aD1 = 0; #declare bD1 = 0; #declare cD1 = 0; #declare ta = tt; define_angulo_perna(aE1, bE1, cE1, ta) define_angulo_perna(aD1, bD1, cD1, mod(ta+0.5,1)) object{ galinha( a1,a2, a31,a41,a51,a32,a42,a52, aE1,bE1,cE1,aD1,bD1,cD1, aD1,bD1,cD1,aE1,bE1,cE1, aE1,bE1,cE1,aD1,bD1,cD1 ) translate < 0,0,0 > } #end union { galinha_andando(clock) } #end quadro(clock) // Original camera parameters: // #local cam_ctr = <0,0,0> // #local cam_vec = <0,0,10.00> // #local cam_sky = z #include "camlight.inc" camlight(<0,0,0>,4.50,<-10,4,10>,20.0,y,1.2)