// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.4, 0.6, 0.8 > } #declare tx_pele = texture{ pigment{ color rgb < 0.99, 0.99, 0.99 > } } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #include "textures.inc" #declare semente1 = seed(45); #declare semente2 = seed(123); #declare semente3 = seed(1); #macro grafico(x0, y0, y1, y2, y3, x3, N) #local i = 0; #while(i < N) #local xx = x0+i*(x3-x0)/N; #local yy = interpola4(x0,y0,y1,y2,y3,x3,xx); object{sphere{yy, 0.1 pigment{ color rgb < 2*sqrt(i/N)*rand(semente1), 2*sqrt(i/N)*rand(semente2), 2*sqrt(i/N)*rand(semente3) > }}} #local i = i + 1; #end #end #macro grafico4(x0, y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, x3, N) union{ grafico(x0, y0, y1, y2, (y2+y3)/2, x0+(x3-x0)/4, N) grafico(x0+(x3-x0)/4, (y2+y3)/2, y3, y4, (y4+y5)/2, x0+(x3-x0)/2, N) grafico(x0+(x3-x0)/2, (y4+y5)/2, y5, y6, (y6+y7)/2, x3-(x3-x0)/4, N) grafico(x3-(x3-x0)/4, (y6+y7)/2, y7, y8, y9, x3, N) } #end #macro interpola(f0,v0,f1,v1,f) #local ss = (f - f0) / (f1 - f0); #local rr = 1 - ss; (rr * v0 + ss * v1) #end #macro interpola4(t0,v0,v1,v2,v3,t3,tt) #local v01 = interpola(t0, v0, t3, v1, tt); #local v12 = interpola(t0, v1, t3, v2, tt); #local v23 = interpola(t0, v2, t3, v3, tt); #local v012 = interpola(t0, v01, t3, v12, tt); #local v123 = interpola(t0, v12, t3, v23, tt); interpola(t0, v012, t3, v123, tt); #end #macro quadro_anterior(fase) #local i = 0; #while(i < NQ-1) #if((tempo[i] <= fase) & ((i = NQ-1) | (tempo[i+1] >= fase))) #local resp = i; #end #local i = i + 1; #end resp #end // ====================================================================== // IBAGENS #include "eixos.inc" // Aqui está a cen a, finalmente: union{ grafico4(0, <5,2,1>, <7,0,3>, <1,-2,1>, <5,0,-1>, <-2,2,2>, <1,-2,-3>, <1,0,-3>, <-2,0,-1>, <3,4,-1>, <5,2,1>, 12, 150) eixos(3) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 10.0; #declare dir_camera = < 5.00, 1.00, 0.00 >; #declare dist_camera = 10.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , y, intens_luz)