// Last edited on 2019-07-17 12:40:54 by stolfilocal // Processed by remove-cam-lights background{ color rgb <0,0,0 > } #declare Yellow = rgb<255, 255, 0>; #declare Black = rgb < 0.4, 0.4, 0.4 >; #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare esfera = sphere { < 0, 0, 0>, 0.25 // Near lower left corner texture{ tx_fosca } } #declare pe = cylinder {<0,0,0>, <7,0,0>, 4} #declare canela = cylinder {<0,0,0>, <20,0,0>, 5} #declare coxa = cylinder {<0,0,0>, <30,0,0>, 8} #declare tronco = cylinder {<0,0,0>, <60,0,0>, 40} #declare articulacao = sphere {<0,0,0>, 3} #include "eixos.inc" object{ eixos(3.00) } #declare NP = 3; #declare NA = 3; #declare NQ = 8; #declare A = array[NP][NA]; #declare A[0][0] = 0; #declare A[0][1] = 0; #declare A[0][2] = 0; #declare A[1][0] = 0; #declare A[1][1] = 0; #declare A[1][2] = 0; #declare A[2][0] = 0; #declare A[2][1] = 0; #declare A[2][2] = 0; #declare Q = array[NQ][NP][NA]; #declare Q[0][0][0] = 0; #declare Q[0][0][1] = 0; #declare Q[0][0][2] = 70; #declare Q[0][1][0] = 60; #declare Q[0][1][1] = 0; #declare Q[0][1][2] = 40; #declare Q[0][2][0] = 0; #declare Q[0][2][1] = 0; #declare Q[0][2][2] = 0; #declare Q[1][0][0] = 0; #declare Q[1][0][1] = 0; #declare Q[1][0][2] = 15; #declare Q[1][1][0] = 0; #declare Q[1][1][1] = 0; #declare Q[1][1][2] = 0; #declare Q[1][2][0] = 50; #declare Q[1][2][1] = 0; #declare Q[1][2][2] = 0; #declare Q[2][0][0] = 0; #declare Q[2][0][1] = 0; #declare Q[2][0][2] = 30; #declare Q[2][1][0] = 0; #declare Q[2][1][1] = 0; #declare Q[2][1][2] = 15; #declare Q[2][2][0] = 0; #declare Q[2][2][1] = 0; #declare Q[2][2][2] = 0; #declare Q[3][0][0] = 0; #declare Q[3][0][1] = 0; #declare Q[3][0][2] = 45; #declare Q[3][1][0] = 0; #declare Q[3][1][1] = 0; #declare Q[3][1][2] = 30; #declare Q[3][2][0] = 0; #declare Q[3][2][1] = 0; #declare Q[3][2][2] = 75; #declare Q[4][0][0] = 0; #declare Q[4][0][1] = 0; #declare Q[4][0][2] = 30; #declare Q[4][1][0] = 0; #declare Q[4][1][1] = 0; #declare Q[4][1][2] = 45; #declare Q[4][2][0] = 0; #declare Q[4][2][1] = 0; #declare Q[4][2][2] = 30; #declare Q[5][0][0] = 0; #declare Q[5][0][1] = 0; #declare Q[5][0][2] = 65; #declare Q[5][1][0] = 0; #declare Q[5][1][1] = 0; #declare Q[5][1][2] = 30; #declare Q[5][2][0] = 0; #declare Q[5][2][1] = 0; #declare Q[5][2][2] = 45; #declare Q[6][0][0] = 0; #declare Q[6][0][1] = 0; #declare Q[6][0][2] = 0; #declare Q[6][1][0] = 0; #declare Q[6][1][1] = 0; #declare Q[6][1][2] = 15; #declare Q[6][2][0] = 0; #declare Q[6][2][1] = 0; #declare Q[6][2][2] = 30; #declare Q[7][0][0] = 0; #declare Q[7][0][1] = 0; #declare Q[7][0][2] = 70; #declare Q[7][1][0] = 60; #declare Q[7][1][1] = 0; #declare Q[7][1][2] = 40; #declare Q[7][2][0] = 0; #declare Q[7][2][1] = 0; #declare Q[7][2][2] = 0; #macro criaPe() union { object{pe} texture {tx_fosca} } #end #macro criaCanelaPe(a) union { object{canela} object {articulacao translate<23,0,0>} object{criaPe() rotate<0,a, 0> translate<26,0,0>} texture {tx_fosca} } #end #macro criaPerna(a,b) union { object{coxa} object {articulacao translate<33,0,0>} object{criaCanelaPe(a) rotate<0,b, 0> translate<36,0,0>} texture {tx_fosca} } #end #macro criaCorpo(a1,b1,c1, a2, b2, c2, a3, b3, c3) union { object{tronco} object {articulacao translate<63,0,0>} object{criaPerna(a1, b1) rotate<0,c1, 0> translate<66,0,0>} object {articulacao translate<63,27,0>} object{criaPerna(a2, b2) rotate<0,c2, 0> translate<66,27,0>} object {articulacao translate<63,-27,0>} object{criaPerna(a3, b3) rotate<0,c3, 0> translate<66,-27,0>} texture {tx_fosca} } #end #macro dragao(A_mat) criaCorpo(A_mat[0][0], A_mat[0][1], A_mat[0][2], A_mat[1][0], A_mat[1][1], A_mat[1][2], A_mat[2][0], A_mat[2][1], A_mat[2][2]) #end #declare nk= 8; #declare tk = array[nk]; #declare tk[0]= 0.000; #declare tk[1]= 0.250; #declare tk[2]= 0.375; #declare tk[3]= 0.5; #declare tk[4]= 0.625; #declare tk[5]= 0.750; #declare tk[6]= 0.875; #declare tk[7]= 1.0; #macro interpola(to, vo, t1, v1, tt ) #local r = (tt-to)/(t1-to); #local s = 1-r; #local vv= s*vo+r*v1; vv #end #macro interpolaAnima(NP, NA, Q, k0, t0, k1, t1, tt, A) #local i = 0; #while(i < NP) #local k = 0; #while(k= tk[k]) & (clk <= tk[k+1])) #local res = k; #end #end res #end #macro makegif(Q, clk, A) #local k = 0; #local k = busca_tempo(clk, nk, tk); interpolaAnima(NP, NA, Q, k, tk[k], k+1, tk[k+1], clk, A) object{dragao(A)} #end object { makegif(Q, clock, A) } #include "camlight.inc" #declare centro_cena = < 60.00, 0.00, 0.00 >; #declare raio_cena = 140.0; #declare dir_camera = < 20.00, 10.00, 50.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)