// Last edited on 2009-10-11 20:48:39 by stolfilocal // Processed by remove-cam-lights #macro eixo(ponta,cor,nome) union{ sphere{ <0,0,0>, 0.02 } cylinder{ <0,0,0>, 0.91*ponta, 0.02 } cone{ 0.90*ponta, 0.06, ponta, 0.00 } texture{ pigment{ color rgb cor } finish{ ambient 0.5 diffuse 0.5 } } } #end #macro eixos(tamanho) union{ object{ eixo( , <1.0,0.2,0.2>, "X") } object{ eixo( <0,tamanho,0>, <0.0,0.8,0.0>, "Y") } object{ eixo( <0,0,tamanho>, <0.3,0.3,1.0>, "Z") } } #end background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_laranja = texture{ pigment{ color rgb < 1.00, 0.50, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_branca = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare raio = 2.000; #macro pe() box{< 0, -1.5, 0 >, < 0.5,1.5, 4 > } #end #macro canela_pe(beta) union{ cylinder{ < 0, 0, 0 >, < 8, 0, 0>, 1 } sphere{< 0, 0, 0 >, 0.95 } sphere{< 0, 0, 0 >, 0.95 translate <8,0,0>} object{pe() rotate beta*y translate 8*x } texture{ tx_fosca_branca} } #end #macro coxa(alfa, beta) union{ cone{ < 0, 0, 0 >, 3, < 10, 0, 0>, 1 texture{ tx_fosca}} sphere{< 0, 0, 0 >, 2.95 texture{ tx_fosca}} object{canela_pe(beta) rotate alfa*y translate 10*x } } #end #macro coxa_posicao(gama, alfa, beta, posicao) object{ coxa(alfa, beta) rotate gama*y rotate 90*y rotate -90*z translate 7*x translate posicao*y } #end #macro cabeca() union{ sphere{< 0, 0, 0 >, 2 } cone{< 1.9, 0, 0 >, 0.5,< 3.2, 0, 0 >, 0 texture{ tx_fosca_laranja} } rotate 60*y translate 2*x } #end #macro pescoco(delta) union{ cylinder{ < 0, 0, 0 >, < 5, 0, 0>, 0.8 } sphere{< 5, 0, 0 >, 0.75 } object{ cabeca() rotate delta*y translate 4*x } texture{ tx_fosca_branca} scale 1.8 } #end #macro asa_ponta() union{ cylinder{ < 0, 0, 0 >, < 8, 0, 0>, 1 } sphere{< 0, 0, 0 >, 0.95 } sphere{< 0, 0, 0 >, 0.95 translate <8,0,0>} } #end #macro asa(epsilon) union{ cylinder{ < 0, 0, 0 >, < 8, 0, 0>, 1} sphere{< 0, 0, 0 >, 0.95 } object{asa_ponta() rotate epsilon*y translate 8*x } texture{ tx_fosca} } #end #macro galinha(gamaE1, gamaE2, gamaE3, gamaD1,gamaD2,gamaD3, alfaE1, alfaE2, alfaE3, alfaD1, alfaD2, alfaD3, betaE1, betaE2, betaE3, betaD1, betaD2, betaD3, teta, delta, epsilon) union{ sphere{ < 0, 0, 0 >, 12 texture{ tx_fosca} scale <0.8,1.3,0.8>} object{coxa_posicao(gamaE1, alfaE1, betaE1, -7)} object{coxa_posicao(gamaE2, alfaE2, betaE2, 0)} object{coxa_posicao(gamaE3, alfaE3, betaE3, 7)} object{coxa_posicao(gamaD1, alfaD1, betaD1, -7) scale <-1,1,1>} object{coxa_posicao(gamaD2, alfaD2, betaD2, 0)scale <-1,1,1>} object{coxa_posicao(gamaD3, alfaD3, betaD3, 7)scale <-1,1,1>} object{ pescoco(delta) rotate teta*y rotate -80*y rotate -90*z translate -11*y translate 6*z } object {asa(epsilon) rotate -45*y rotate 60*x translate 7*x translate 5*z } object {asa(epsilon) rotate -45*y rotate 60*x translate 7*x translate 5*z scale <-1,1,1> } scale 0.2 } #end #macro define_angulos_perna(a, b, c, te) #local t0 = 0.0000; #local t1 = 0.2000; #local t2 = 0.4000; #local t3 = 0.6000; #local t4 = 0.8000; #local t5 = 1.0000; #local a0 = 15; #local a1 = -20; #local a2 = -40; #local a3 = -30; #local a4 = -20; #local a5 = 15; #local b0 = 10; #local b1 = 40; #local b2 = 40; #local b3 = 10; #local b4 = 40; #local b5 = 10; #local c0 = 0 -a0 - b0; #local c1 = -40; #local c2 = -40; #local c3 = 0 -a3 - b3; #local c4 = 0 -a4 - b4; #local c5 = 0 -a5 - b5; #local tc = te; #if (tc>1) #local tc = tc-1; #end #if ((tc>=t0) & (tc=t1) & (tc=t2) & (tc=t3) & (tc=t4) & (tc<=t5)) interpola_perna(a, b, c, a4, b4, c4, a5, b5, c5, tc, 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) #declare gamaE1 = 0; #declare gamaE2 = 0; #declare gamaE3 = 0; #declare gamaD1 = 0; #declare gamaD2 = 0; #declare gamaD3 = 0; #declare alfaE1 = 0; #declare alfaE2 = 0; #declare alfaE3 = 0; #declare alfaD1 = 0; #declare alfaD2 = 0; #declare alfaD3 = 0; #declare betaE1 = 0; #declare betaE2 = 0; #declare betaE3 = 0; #declare betaD1 = 0; #declare betaD2 = 0; #declare betaD3 = 0; #local teta = 45; #local delta = 10; #local epsilon = 90; #declare xyz =0; #declare ta = tt; #declare tb = tt+0.5; define_angulos_perna(gamaE1, alfaE1, betaE1, ta) define_angulos_perna(gamaE2, alfaE2, betaE2, ta) define_angulos_perna(gamaE3, alfaE3, betaE3, ta) define_angulos_perna(gamaD1, alfaD1, betaD1, tb) define_angulos_perna(gamaD2, alfaD2, betaD2, tb) define_angulos_perna(gamaD3, alfaD3, betaD3, tb) object { galinha( gamaE1, gamaE2, gamaE3, gamaD1,gamaD2,gamaD3, alfaE1, alfaE2, alfaE3, alfaD1, alfaD2, alfaD3, betaE1, betaE2, betaE3, betaD1, betaD2, betaD3, teta, delta, epsilon ) rotate 70*z } #end galinha_andando(clock) // Original camera parameters: // #local cam_ctr = <0.00,0.00,1.00> // #local cam_vec = (<14.00,7.00,7.00>-<0.00,0.00,1.00>) // #local cam_sky = z #include "camlight.inc" camlight(<+0.50,0.00,-0.50>,7.5,<10,10,4>,30.0,z,1.2)