// Last edited on 2019-07-17 07:38:16 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_cor00 = texture{ pigment{ color rgb < 0.30, 1.00, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 1.0 roughness 0.005 } } #declare tx_cor01 = texture{ pigment{ color rgb < 1.00, 0.20, 0.20 > } finish{ diffuse 0.6 ambient 0.1 specular 1.0 roughness 0.005 } } #declare tx_cor02 = texture{ pigment{ color rgb < 0.30, 0.30, 1.00 > } finish{ diffuse 0.5 ambient 0.1 specular 1.0 roughness 0.005 } } #declare rad = 0.2; #declare esfera = sphere{ < 0, 0, 0>, rad } #include "eixos.inc" #macro valor_matriz () #local P = array [6][8][4]; #local P[0][0][0] = <0, 0, 0>; #local P[0][0][1] = <-0.5, 0.75, 0>; #local P[0][0][2] = <-1, 1.5, 0>; #local P[0][0][3] = <-2, 3, 0>; #local P[0][1][0] = <-2, 3, 0>; #local P[0][1][1] = <-3, 4.5, 0>; #local P[0][1][2] = <-2, 3.75, -1>; #local P[0][1][3] = <-2, 3,-1>; #local P[0][2][0] = <-2, 3,-1>; #local P[0][2][1] = <-2, 2.25, -1>; #local P[0][2][2] = <-2, 1.75, -1>; #local P[0][2][3] = <-2, 1.5, -1>; #local P[0][3][0] = <-2, 1.5, -1>; #local P[0][3][1] = <-2, 1.25, -1>; #local P[0][3][2] = <-2, 1.0, -0.25>; #local P[0][3][3] = <-2, 1.0, 0.0>; #local P[0][4][0] = <-2, 1.0, 0.0>; #local P[0][4][1] = <-2, 1.0, 0.25>; #local P[0][4][2] = <-2, 1.0, 0.75>; #local P[0][4][3] = <-2, 1.0, 1>; #local P[0][5][0] = <-2, 1.0, 1>; #local P[0][5][1] = <-2, 1.0, 1.25>; #local P[0][5][2] = <-0, 1.3, 2>; #local P[0][5][3] = <-0.5, 3, 1>; #local P[0][6][0] = <-0.5, 3, 1>; #local P[0][6][1] = <-1, 4.3, 0>; #local P[0][6][2] = <-4, 1.5, -2>; #local P[0][6][3] = <-3, 0, -1.4>; #local P[0][7][0] = <-3, 0, -1.4>; #local P[0][7][1] = <-2, -1.5, -0.8>; #local P[0][7][2] = <1, -1.5, 0>; #local P[0][7][3] = <0, 0, 0>; #local P[1][0][0] = <0, 3, 0>; #local P[1][0][1] = <-1, 3.25, 1>; #local P[1][0][2] = <-2, 3.75, 2>; #local P[1][0][3] = <-3, 4, 0>; #local P[1][1][0] = <-3, 4, 0>; #local P[1][1][1] = <-5, 4.75, 0.5>; #local P[1][1][2] = <-5, 3.75, -1.5>; #local P[1][1][3] = <-3, 4, -2>; #local P[1][2][0] = <-3, 4, -2>; #local P[1][2][1] = <-6, 1.25, -1>; #local P[1][2][2] = <-7, 1.25, -1>; #local P[1][2][3] = <-2, 1.5, -1>; #local P[1][3][0] = <-2, 1.5, -1>; #local P[1][3][1] = <-2, 2.25, -1>; #local P[1][3][2] = <-2, 2.0, -0.25>; #local P[1][3][3] = <-2, 1.0, 0.0>; #local P[1][4][0] = <-2, 1.0, 0.0>; #local P[1][4][1] = <-2, 0, 2.25>; #local P[1][4][2] = <-5, 0, 1.75>; #local P[1][4][3] = <-2, 1.0, 1>; #local P[1][5][0] = <-2, 1.0, 1>; #local P[1][5][1] = <-1, 3.0, 1.0>; #local P[1][5][2] = <-0, 3.3, 0.5>; #local P[1][5][3] = <-0.5, 3, 1>; #local P[1][6][0] = <-0.5, 3, 1>; #local P[1][6][1] = <-1, 5.3, 0>; #local P[1][6][2] = <-4, 6.5, -0>; #local P[1][6][3] = <-3, 0, -1.4>; #local P[1][7][0] = <-3, 0, -1.4>; #local P[1][7][1] = <-2, -2.5, -0.8>; #local P[1][7][2] = <4, -1.5, -4>; #local P[1][7][3] = <0, 0, 0>; #local P[2][0][0] = <0, 4, 0>; #local P[2][0][1] = <-1, 4.25, 1>; #local P[2][0][2] = <-2, 3.75, 2>; #local P[2][0][3] = <-3, 4, 0>; #local P[2][1][0] = <-3, 4, 0>; #local P[2][1][1] = <-5, 4.75, 0.5>; #local P[2][1][2] = <-5, 8.75, -1.5>; #local P[2][1][3] = <-3, 4, -2>; #local P[2][2][0] = <-3, 4, -2>; #local P[2][2][1] = <-6, 8.25, -1>; #local P[2][2][2] = <-7, 1.25, -1>; #local P[2][2][3] = <-2, 1.5, -1>; #local P[2][3][0] = <-2, 1.5, -1>; #local P[2][3][1] = <-2, 2.25, -1>; #local P[2][3][2] = <-2, 9.0, -0.25>; #local P[2][3][3] = <-2, 1.0, 0.0>; #local P[2][4][0] = <-2, 1.0, 0.0>; #local P[2][4][1] = <-2, 0, 2.25>; #local P[2][4][2] = <-5, -2, 1.75>; #local P[2][4][3] = <-2, 1.0, 1>; #local P[2][5][0] = <-2, 1.0, 1>; #local P[2][5][1] = <-1, 1.0, 1.0>; #local P[2][5][2] = <-0, 3.3, 0.5>; #local P[2][5][3] = <-0.5, 3, 1>; #local P[2][6][0] = <-0.5, 3, 1>; #local P[2][6][1] = <-1, 1.3, 0>; #local P[2][6][2] = <-4, 6.5, -0>; #local P[2][6][3] = <-3, 0, -1.4>; #local P[2][7][0] = <-3, 0, -1.4>; #local P[2][7][1] = <-2, -2.5, -0.8>; #local P[2][7][2] = <4, -1.5, -4>; #local P[2][7][3] = <0, 0, 0>; #local P[3][0][0] = <0, 3, 0>; #local P[3][0][1] = <-1, 3.25, 1>; #local P[3][0][2] = <-2, 1.75, 2>; #local P[3][0][3] = <-3, 4, 0>; #local P[3][1][0] = <-3, 4, 0>; #local P[3][1][1] = <-5, 1.75, 0.5>; #local P[3][1][2] = <-5, 3.75, -1.5>; #local P[3][1][3] = <-3, 4, -2>; #local P[3][2][0] = <-3, 4, -2>; #local P[3][2][1] = <-6, -1.25, -1>; #local P[3][2][2] = <-7, -1.25, -1>; #local P[3][2][3] = <-2, 1.5, -1>; #local P[3][3][0] = <-2, 1.5, -1>; #local P[3][3][1] = <-2, -2.25, -1>; #local P[3][3][2] = <-2, -2.0, -0.25>; #local P[3][3][3] = <-2, 1.0, 0.0>; #local P[3][4][0] = <-2, 1.0, 0.0>; #local P[3][4][1] = <-2, 9, 2.25>; #local P[3][4][2] = <-5, 0, 1.75>; #local P[3][4][3] = <-2, 1.0, 1>; #local P[3][5][0] = <-2, 1.0, 1>; #local P[3][5][1] = <-9, -3.0, 1.0>; #local P[3][5][2] = <-0, -3.3, 0.5>; #local P[3][5][3] = <-0.5, 3, 1>; #local P[3][6][0] = <-0.5, 3, 1>; #local P[3][6][1] = <-9, 1.3, 0>; #local P[3][6][2] = <-9, 1.5, -0>; #local P[3][6][3] = <-3, 0, -1.4>; #local P[3][7][0] = <-3, 0, -1.4>; #local P[3][7][1] = <-2, 2.5, -0.8>; #local P[3][7][2] = <4, 9.5, -4>; #local P[3][7][3] = <0, 0, 0>; #local P[4][0][0] = <0, 3, 0>; #local P[4][0][1] = <-1, 3.25, 1>; #local P[4][0][2] = <-2, 1.75, 2>; #local P[4][0][3] = <-3, 4, 0>; #local P[4][1][0] = <-3, 4, 0>; #local P[4][1][1] = <-5, 1.75, 0.5>; #local P[4][1][2] = <-5, 3.75, -1.5>; #local P[4][1][3] = <-3, 4, -2>; #local P[4][2][0] = <-3, 4, -2>; #local P[4][2][1] = <-6, -1.25, -1>; #local P[4][2][2] = <-7, -1.25, -1>; #local P[4][2][3] = <-2, 1.5, -1>; #local P[4][3][0] = <-2, 1.5, -1>; #local P[4][3][1] = <-2, 3.25, -1>; #local P[4][3][2] = <-2, 3.0, -0.25>; #local P[4][3][3] = <-2, 1.0, 0.0>; #local P[4][4][0] = <-2, 1.0, 0.0>; #local P[4][4][1] = <-2, 1, 2.25>; #local P[4][4][2] = <-5, 2, 1.75>; #local P[4][4][3] = <-2, 1.0, 1>; #local P[4][5][0] = <-2, 1.0, 1>; #local P[4][5][1] = <-1, -2.0, 1.0>; #local P[4][5][2] = <-0, -2.3, 0.5>; #local P[4][5][3] = <-0.5, 3, 1>; #local P[4][6][0] = <-0.5, 3, 1>; #local P[4][6][1] = <-1, 1.3, 0>; #local P[4][6][2] = <-4, 1.5, -0>; #local P[4][6][3] = <-3, 0, -1.4>; #local P[4][7][0] = <-3, 0, -1.4>; #local P[4][7][1] = <-2, 2.5, -0.8>; #local P[4][7][2] = <4, 9.5, -4>; #local P[4][7][3] = <0, 0, 0>; #local P[5][0][0] = <0, 0, 0>; #local P[5][0][1] = <-0.5, 0.75, 0>; #local P[5][0][2] = <-1, 1.5, 0>; #local P[5][0][3] = <-2, 3, 0>; #local P[5][0][0] = <0, 0, 0>; #local P[5][0][1] = <-0.5, 0.75, 0>; #local P[5][0][2] = <-1, 1.5, 0>; #local P[5][0][3] = <-2, 3, 0>; #local P[5][1][0] = <-2, 3, 0>; #local P[5][1][1] = <-3, 4.5, 0>; #local P[5][1][2] = <-2, 3.75, -1>; #local P[5][1][3] = <-2, 3,-1>; #local P[5][2][0] = <-2, 3,-1>; #local P[5][2][1] = <-2, 2.25, -1>; #local P[5][2][2] = <-2, 1.75, -1>; #local P[5][2][3] = <-2, 1.5, -1>; #local P[5][3][0] = <-2, 1.5, -1>; #local P[5][3][1] = <-2, 1.25, -1>; #local P[5][3][2] = <-2, 1.0, -0.25>; #local P[5][3][3] = <-2, 1.0, 0.0>; #local P[5][4][0] = <-2, 1.0, 0.0>; #local P[5][4][1] = <-2, 1.0, 0.25>; #local P[5][4][2] = <-2, 1.0, 0.75>; #local P[5][4][3] = <-2, 1.0, 1>; #local P[5][5][0] = <-2, 1.0, 1>; #local P[5][5][1] = <-2, 1.0, 1.25>; #local P[5][5][2] = <-0, 1.3, 2>; #local P[5][5][3] = <-0.5, 3, 1>; #local P[5][6][0] = <-0.5, 3, 1>; #local P[5][6][1] = <-1, 4.3, 0>; #local P[5][6][2] = <-4, 1.5, -2>; #local P[5][6][3] = <-3, 0, -1.4>; #local P[5][7][0] = <-3, 0, -1.4>; #local P[5][7][1] = <-2, -1.5, -0.8>; #local P[5][7][2] = <1, -1.5, 0>; #local P[5][7][3] = <0, 0, 0>; P #end #macro valor_tk () #local tk = array[6]; #local tk[0] = 0.0; #local tk[1] = 0.2; #local tk[2] = 0.4; #local tk[3] = 0.6; #local tk[4] = 0.8; #local tk[5] = 1.0; tk #end #macro find_tk (c, tk, NK) #local i = 0; #local res = NK-2; #while (i < NK-2) #if (c >= tk[i]) #if (c < tk[i+1]) #local res = i; #end #end #local i = i+1; #end res #end #macro interpola (t0, v0, t1, v1, tt) #local r = (tt-t0)/(t1-t0); #local s = 1-r; #local vv = s*v0 + r*v1; vv #end #macro arcobezier (t0, t1, A, B , C, D, tt) #local AB = interpola (t0, A, t1, B, tt); #local BC = interpola (t0, B, t1, C, tt); #local CD = interpola (t0, C, t1, D, tt); #local ABC = interpola (t0, AB, t1, BC, tt); #local BCD = interpola (t0, BC, t1, CD, tt); #local ABCD = interpola (t0, ABC, t1, BCD, tt); ABCD #end #macro interpola_matrix (P, t0, t1, N, c0, c1, cc, R) #local i = 0; #while (i < N) #local j = 0; #while (j < 4) #local R[i][j] = interpola (c0, P[t0][i][j], c1, P[t1][i][j], cc); #local j = j+1; #end #local i = i+1; #end #end #macro suav (P, NA, NK) #local tt = 0; #while ( tt < NK) #local i = 0; #while ( i < NA ) #if ( i > 0 ) #local P[tt][i][0] = (P[tt][i][1]+P[tt][i-1][2])/2; #local P[tt][i-1][3] = P[tt][i][0]; #else #local P[tt][i][0] = (P[tt][i][1]+P[tt][NA-1][2])/2; #local P[tt][NA-1][3] = P[tt][i][0]; #end #local i = i+1; #end #local tt = tt+1; #end P #end #macro noh_3 (P, tt, N, M, cor) union { #local m = 1/M; #local i = 0; #while ( i < N ) #local j = i; #while ( j < i+1 ) object { esfera translate arcobezier (i, i+1, P[tt][i][0], P[tt][i][1] , P[tt][i][2], P[tt][i][3], j) texture{ cor } } #local j = j+m; #end #local i = i+1; #end } #end #macro noh (P, N, M, cor) union { #local m = 1/M; #local i = 0; #while ( i < N ) #local j = i; #while ( j < i+1 ) object { esfera translate arcobezier (i, i+1, P[i][0], P[i][1] , P[i][2], P[i][3], j) texture{ cor } } #local j = j+m; #end #local i = i+1; #end } #end // object{ eixos(3.00) } #declare NA = 8; // Num de arcos #declare NK = 6; // Num de quadoros chaves #declare P = valor_matriz (); #declare P = suav (P, NA, NK); #declare tk = valor_tk(); #declare R = array [NA][4]; #declare nt = find_tk(clock, tk, NK); interpola_matrix (P, nt, nt+1, NA, tk[nt], tk[nt+1], clock, R) object{ noh (R, NA, 300, tx_cor01)} #include "camlight.inc" #declare centro_cena = < -3.00, 2.00, -1.00 >; //sphere{ centro_cena, 1.0 texture{ tx_cor00 } } #declare raio_cena = 8.0; #declare dir_camera = < 10.00, 7.00, 4.00 >; #declare dist_camera = 10*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)