// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2017-05-07 20:10:09 by stolfilocal // ====================================================================== // CORES E TEXTURAS 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 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare rad = 0.2; // Partes da cena: #declare esfera = sphere{ < 0, 0, 0>, rad } #include "eixos.inc" #macro valor_matriz_0 () #local P = array [8][4]; #local P[0][0] = <0, 0, 0>; #local P[0][1] = <-0.5, 0.75, 0>; #local P[0][2] = <-1, 1.5, 0>; #local P[0][3] = <-2, 3, 0>; #local P[1][0] = <-2, 3, 0>; #local P[1][1] = <-3, 4.5, 0>; #local P[1][2] = <-2, 3.75, -1>; #local P[1][3] = <-2, 3,-1>; #local P[2][0] = <-2, 3,-1>; #local P[2][1] = <-2, 2.25, -1>; #local P[2][2] = <-2, 1.75, -1>; #local P[2][3] = <-2, 1.5, -1>; #local P[3][0] = <-2, 1.5, -1>; #local P[3][1] = <-2, 1.25, -1>; #local P[3][2] = <-2, 1.0, -0.25>; #local P[3][3] = <-2, 1.0, 0.0>; #local P[4][0] = <-2, 1.0, 0.0>; #local P[4][1] = <-2, 1.0, 0.25>; #local P[4][2] = <-2, 1.0, 0.75>; #local P[4][3] = <-2, 1.0, 1>; #local P[5][0] = <-2, 1.0, 1>; #local P[5][1] = <-2, 1.0, 1.25>; #local P[5][2] = <-0, 1.3, 2>; #local P[5][3] = <-0.5, 3, 1>; #local P[6][0] = <-0.5, 3, 1>; #local P[6][1] = <-1, 4.3, 0>; #local P[6][2] = <-4, 1.5, -2>; #local P[6][3] = <-3, 0, -1.4>; #local P[7][0] = <-3, 0, -1.4>; #local P[7][1] = <-2, -1.5, -0.8>; #local P[7][2] = <1, -1.5, 0>; #local P[7][3] = <0, 0, 0>; P #end #macro valor_matriz_1 () #local P = array [8][4]; #local P[0][0] = <0, 3, 0>; #local P[0][1] = <-1, 3.25, 1>; #local P[0][2] = <-2, 3.75, 2>; #local P[0][3] = <-3, 4, 0>; #local P[1][0] = <-3, 4, 0>; #local P[1][1] = <-5, 4.75, 0.5>; #local P[1][2] = <-5, 3.75, -1.5>; #local P[1][3] = <-3, 4, -2>; #local P[2][0] = <-3, 4, -2>; #local P[2][1] = <-6, 1.25, -1>; #local P[2][2] = <-7, 1.25, -1>; #local P[2][3] = <-2, 1.5, -1>; #local P[3][0] = <-2, 1.5, -1>; #local P[3][1] = <-2, 2.25, -1>; #local P[3][2] = <-2, 2.0, -0.25>; #local P[3][3] = <-2, 1.0, 0.0>; #local P[4][0] = <-2, 1.0, 0.0>; #local P[4][1] = <-2, 0, 2.25>; #local P[4][2] = <-5, 0, 1.75>; #local P[4][3] = <-2, 1.0, 1>; #local P[5][0] = <-2, 1.0, 1>; #local P[5][1] = <-1, 3.0, 1.0>; #local P[5][2] = <-0, 3.3, 0.5>; #local P[5][3] = <-0.5, 3, 1>; #local P[6][0] = <-0.5, 3, 1>; #local P[6][1] = <-1, 5.3, 0>; #local P[6][2] = <-4, 6.5, -0>; #local P[6][3] = <-3, 0, -1.4>; #local P[7][0] = <-3, 0, -1.4>; #local P[7][1] = <-2, -2.5, -0.8>; #local P[7][2] = <4, -1.5, -4>; #local P[7][3] = <0, 0, 0>; P #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, Q, N c0, c1, cc, R) #local i = 0; #while (i < N) #local j = 0; #while (j < 4) #local R[i][j] = interpola (c0, P[i][j], c1, Q[i][j], cc); #local j = j+1; #end #local i = i+1; #end #end #macro suav (P, e) #local i = 0; #while ( i < e ) #if ( i > 0 ) #local P[i][0] = (P[i][1]+P[i-1][2])/2; #local P[i-1][3] = P[i][0]; #else #local P[i][0] = (P[i][1]+P[e-1][2])/2; #local P[e-1][3] = P[i][0]; #end #local i = i+1; #end P #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 // Aqui está a cena, finalmente: object{ eixos(3.00) } #declare N = 8; #declare tv = 20; #declare P = valor_matriz_0 (); #declare P = suav (P, N); //noh (P, N, 300, tx_cor00) #declare Q = valor_matriz_1 (); #declare Q = suav (Q, N); //noh (Q, 8, 300, tx_cor01) #declare R = array [8][N]; #declare i = 0; #while (i <= 1) interpola_matrix (P, Q, N, 0, 1, i, R) object{ noh (R, 8, 300, tx_cor01) translate <0, i*tv, 0>} #declare i = i+0.25; #end #include "camlight.inc" #declare centro_cena = < 5.00, 12.00, 0.00 >; #declare raio_cena = 15.0; #declare dir_camera = < 5.00, 0.00, 0.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)