// Last edited on 2009-10-11 20:39:34 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_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.40, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_amarelo = texture{ pigment{ color rgb < 1.00, 0.80, 0.20 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_cinza = texture{ pigment{ color rgb < 0.60, 0.60, 0.60 > } finish{ diffuse 0.9 ambient 0.1 } } #declare raio = 2.000; #declare ex_esfera = sphere{ < 0.00, 0.00, 0.00 >, raio texture{ tx_plastico } } #declare ex_esfera = cylinder{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 >, 0.75 texture{ tx_fosca } } #declare ex_caixa = box{ < +0.00, +0.00, +3.00 >, < +3.00, +3.00, +0.00 > texture{ tx_fosca } } #declare ex_diferenca = difference{ object{ ex_caixa } union{ object{ ex_esfera } object{ ex_caixa } } } #declare membro = union{ cylinder{ < +0.00, +0.00, +0.00 >, < +0.00, +0.00, +1.30 >, 0.20 texture{ tx_amarelo } } sphere{ < +0.00, +0.00, +1.30 >, 0.26 texture{ tx_plastico } } } #declare milho = sphere{ < 0.00, 0.00, 0.00 >, +0.10 texture{ tx_amarelo } } #declare rabico = cone{ < +0.00, +0.00, +0.00 >, 0.00, < +0.00, -2.00, +0.00 >, 0.60 texture{ tx_fosca } } #macro galinha( pesc, cab_cima, cab_lado, pern1, can1, pe11, pe12, pern2, can2, pe21, pe22, pern3, can3, pe31, pe32, pern4, can4, pe41, pe42, pern5, can5, pe51, pe52, pern6, can6, pe61, pe62, asa11, asa12, asa13, asa14, asa21, asa22, asa23, asa24, asa31, asa32, asa33, asa34, asa41, asa42, asa43, asa44 ) union{ sphere{ < 0.00, -1.00, 0.00 >, +2.00 scale < +0.00, +2.00, +0.00 > texture{ tx_cinza } } object{ rabico rotate -30 * x translate < +0.00, -5.70, +0.50 > } union{ object{ cabeca_pescoco( cab_cima, cab_lado ) rotate pesc * x translate < +0.00, +1.60, +1.00 > } sphere{ < +0.00, +1.60, +1.00 >, 0.26 texture{ tx_plastico } } } object{ perna( can1, pe11, pe12 ) rotate pern1 * x translate < +1.60, -0.70, -1.00 > } object{ perna( can2, pe21, pe22 ) rotate pern2 * x translate < +1.80, -2.20, -1.00 > } object{ perna( can3, pe31, pe32 ) rotate pern3 * x translate < +1.60, -3.70, -1.00 > } object{ perna( can4, pe41, pe42 ) rotate pern4 * x translate < -1.60, -0.70, -1.00 > } object{ perna( can5, pe51, pe52 ) rotate pern5 * x translate < -1.80, -2.20, -1.00 > } object{ perna( can6, pe61, pe62 ) rotate pern6 * x translate < -1.60, -3.70, -1.00 > } object{ asa( asa13, asa14 ) rotate asa12 * y rotate asa11 * x translate < +1.70, -1.00, +1.00 > } object{ asa( asa23, asa24 ) rotate asa22 * y rotate asa21 * x translate < -1.70, -1.00, +1.00 > } object{ asa( asa33, asa34 ) rotate asa32 * y rotate asa31 * x translate < +1.70, -3.00, +1.00 > } object{ asa( asa43, asa44 ) rotate asa42 * y rotate asa41 * x translate < -1.70, -3.00, +1.00 > } } #end #macro asa( a, ante ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ asa_ante( ante ) rotate a * x translate < +0.00, +0.00, -1.30 > } } #end #macro asa_ante( a ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ asa_ponta rotate a * x translate < +0.00, +0.00, -1.30 > } } #end #declare asa_ponta = union{ cone{ < +0.00, +0.00, +0.00 >, 0.20, < +0.00, -1.30, +0.00 >, 0.00 texture{ tx_amarelo } } sphere{ < +0.00, +0.00, +0.00 >, 0.26 texture{ tx_plastico } } } #macro cabeca_pescoco( a, b ) union{ object{ membro } object{ cabeca rotate a * x rotate b * z translate < +0.00, +0.00, +2.50 > } } #end #declare bico = cone{ < +0.00, +1.00, +0.00 >, +0.20, < +0.00, +1.50, +0.00 >, +0.00 texture{ tx_amarelo } } #declare cabeca = union{ sphere{ < 0.00, 0.00, 0.00 >, +1.00 texture{ tx_fosca } } object{ bico } sphere{ < 0.55, 0.55, 0.55 >, +0.10 texture{ tx_cinza } } sphere{ < -0.55, 0.55, 0.55 >, +0.10 texture{ tx_cinza } } } #macro perna( can, pe1, pe2 ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ canela( pe1, pe2 ) rotate can * x translate < +0.00, +0.00, -1.30 > } } #end #macro canela( a, b ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ pe rotate a * x rotate b * y translate < +0.00, +0.00, -1.40 > } } #end #declare pe = union{ sphere{ < +0.00, +0.00, +0.00 >, 0.26 texture{ tx_plastico } } box{ < -0.26, -0.26, -0.26 >, < +0.26, +0.60, -0.35 > texture{ tx_fosca } } } #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 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 define_angulo_perna( a, b, c, tt ) #local t0 = 0.0; #local a0 = -15; #local b0 = -10; #local c0 = 0 - a0 - b0; #local t1 = 0.2; #local a1 = +20; #local b1 = -40; #local c1 = +40; #local t2 = 0.4; #local a2 = +40; #local b2 = -40; #local c2 = +40; #local t3 = 0.6; #local a3 = +30; #local b3 = -10; #local c3 = 0 - a3 - b3; #local t4 = 0.8; #local a4 = +10; #local b4 = -20; #local c4 = 0 - a4 - b4; #local t5 = 1.0; #local a5 = -15; #local b5 = -10; #local c5 = 0 - a5 - b5; #if( tt > 1.0 ) #local tt = tt - 1.0; #end #if( ( tt >= t0 ) & ( tt < t1 ) ) interpola_perna( a, b, c, a0, b0, c0, a1, b1, c1, tt, t0, t1 ) #end #if( ( tt >= t1 ) & ( tt < t2 ) ) interpola_perna( a, b, c, a1, b1, c1, a2, b2, c2, tt, t1, t2 ) #end #if( ( tt >= t2 ) & ( tt < t3 ) ) interpola_perna( a, b, c, a2, b2, c2, a3, b3, c3, tt, t2, t3 ) #end #if( ( tt >= t3 ) & ( tt < t4 ) ) interpola_perna( a, b, c, a3, b3, c3, a4, b4, c4, tt, t3, t4 ) #end #if( ( tt >= t4 ) & ( tt <= t5 ) ) interpola_perna( a, b, c, a4, b4, c4, a5, b5, c5, tt, t4, t5 ) #end #end #macro interpola_cabeca( 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 define_angulo_cabeca( a, b, c, tt ) #local t0 = 0.0; #local a0 = -30; #local b0 = +30; #local c0 = 0; #local t1 = 0.5; #local a1 = -10; #local b1 = +10; #local c1 = -20; #local t2 = 1.0; #local a2 = -30; #local b2 = +30; #local c2 = 0; #if( ( tt >= t0 ) & ( tt < t1 ) ) interpola_cabeca( a, b, c, a0, b0, c0, a1, b1, c1, tt, t0, t1 ) #end #if( ( tt >= t1 ) & ( tt <= t2 ) ) interpola_cabeca( a, b, c, a1, b1, c1, a2, b2, c2, tt, t1, t2 ) #end #end #macro interpola_asa( 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 define_angulo_asa( a, b, c, tt ) #local t0 = 0.0; #local a0 = -100; #local b0 = +120; #local c0 = +130; #local t1 = 0.5; #local a1 = -150; #local b1 = +30; #local c1 = +90; #local t2 = 1.0; #local a2 = -100; #local b2 = +120; #local c2 = +130; #if( ( tt >= t0 ) & ( tt < t1 ) ) interpola_asa( a, b, c, a0, b0, c0, a1, b1, c1, tt, t0, t1 ) #end #if( ( tt >= t1 ) & ( tt <= t2 ) ) interpola_asa( a, b, c, a1, b1, c1, a2, b2, c2, tt, t1, t2 ) #end #end #macro galinha_andando( tt ) #declare ae = 0.0; #declare be = 0.0; #declare ge = 0.0; #declare ad = 0.0; #declare bd = 0.0; #declare gd = 0.0; #declare ac = 0.0; #declare bc = 0.0; #declare gc = 0.0; #declare aa = 0.0; #declare ba = 0.0; #declare ga = 0.0; #local te = tt; #local td = tt + 0.5; define_angulo_perna( ae, be, ge, te ) define_angulo_perna( ad, bd, gd, td ) define_angulo_cabeca( ac, bc, gc, tt ) define_angulo_asa( aa, ba, ga, tt ) #local pesc = ac; #local cab_cima = bc; #local cab_lado = gc; #local pern1 = ae; #local can1 = be; #local pe11 = ge; #local pe12 = 0; #local pern2 = ad; #local can2 = bd; #local pe21 = gd; #local pe22 = 0; #local pern3 = ae; #local can3 = be; #local pe31 = ge; #local pe32 = 0; #local pern4 = ad; #local can4 = bd; #local pe41 = gd; #local pe42 = 0; #local pern5 = ae; #local can5 = be; #local pe51 = ge; #local pe52 = 0; #local pern6 = ad; #local can6 = bd; #local pe61 = gd; #local pe62 = 0; #local asa11 = aa; #local asa12 = -50; #local asa13 = ba; #local asa14 = ga; #local asa21 = aa; #local asa22 = 50; #local asa23 = ba; #local asa24 = ga; #local asa31 = aa; #local asa32 = -50; #local asa33 = ba; #local asa34 = ga; #local asa41 = aa; #local asa42 = 50; #local asa43 = ba; #local asa44 = ga; object{ galinha( pesc, cab_cima, cab_lado, pern1, can1, pe11, pe12, pern2, can2, pe21, pe22, pern3, can3, pe31, pe32, pern4, can4, pe41, pe42, pern5, can5, pe51, pe52, pern6, can6, pe61, pe62, asa11, asa12, asa13, asa14, asa21, asa22, asa23, asa24, asa31, asa32, asa33, asa34, asa41, asa42, asa43, asa44 ) } #end object{ galinha_andando( clock ) } // Original camera parameters: // #local cam_ctr = <0.00,0.00,2.00> // #local cam_vec = ((1.0 * <14.00,10.00,5.00>)-<0.00,0.00,2.00>) // #local cam_sky = z #include "camlight.inc" camlight(<0.00,-1.00,0.00>,8.2,<10,10,4>,30.0,z,1.2)