// 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.00, 0.00, 0.00 > } finish{ diffuse 0.5 ambient 0.8 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 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 valor_matriz () #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 suav (P, e) #local i = 0; #while ( i < e ) #if ( i > 0 ) #declare P[i][0] = (P[i][1]+P[i-1][2])/2; #declare P[i-1][3] = P[i][0]; #else #declare P[i][0] = (P[i][1]+P[e-1][2])/2; #declare P[e-1][3] = P[i][0]; #end #local i = i+1; #end P #end #macro noh () union { #declare space = rad / 100; #declare P = valor_matriz (); #declare P = suav (P, 8); #declare i = 0; #while ( i < 8 ) # if (i < 1) object { esfera translate interpola(0, P[0][0], 1, P[0][3], i) texture{ tx_cor00 } } #end #if ((i >= 1) & (i < 2)) object { esfera translate arcobezier (1, 2, P[1][0], P[1][1] , P[1][2], P[1][3], i) texture{ tx_cor00 } } #end #if ((i >= 2) & (i < 3)) object { esfera translate interpola(2, P[2][0], 3, P[2][3], i) texture{ tx_cor00 } } #end #if ((i >= 3) & (i < 4)) object { esfera translate arcobezier (3, 4, P[3][0], P[3][1] , P[3][2], P[3][3], i) texture{ tx_cor00 } } #end #if ((i >= 4) & (i < 5)) object { esfera translate interpola(4, P[4][0], 5, P[4][3], i) texture{ tx_cor00 } } #end #if ((i >= 5) & (i < 6)) object { esfera translate arcobezier (5, 6, P[5][0], P[5][1] , P[5][2], P[5][3], i) texture{ tx_cor00 } } #end #if ((i >= 6) & (i < 7)) object { esfera translate arcobezier (6, 7, P[6][0], P[6][1] , P[6][2], P[6][3], i) texture{ tx_cor00 } } #end #if (i >= 7) object { esfera translate arcobezier (7, 8, P[7][0], P[7][1] , P[7][2], P[7][3], i) texture{ tx_cor00 } } #end #declare i = i+space; #end } #end // Aqui está a cena, finalmente: object{ eixos(3.00) } noh () #include "camlight.inc" #declare centro_cena = < 5.00, 0.00, 0.00 >; #declare raio_cena = 5.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)