// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_vermelha = texture{ pigment{ color rgb < 1.00, 0, 0 > } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_verde = texture{ pigment{ color rgb < 0, 1, 0 > } } #declare tx_azul = texture{ pigment{ color rgb < 0, 0, 1.00 > } } #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_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #macro interpola4(t0, a0, a1, a2, a3, t3, tt) #local a01 = interpola(t0, a0, t3, a1, tt); #local a12 = interpola(t0, a1, t3, a2, tt); #local a23 = interpola(t0, a2, t3, a3, tt); #local a012 = interpola(t0, a01, t3, a12, tt); #local a123 = interpola(t0, a12, t3, a23, tt); #local a01234 = interpola(t0, a012, t3, a123, tt); (a01234) #end #macro grafico(x0, y0, y1, y2, y3, x3, n) #local delta = (x3-x0)/n; #local i = 0; #local xx = x0; #while (i <= n) #local yy = interpola4(x0, y0, y1, y2, y3, x3, xx); object {sphere { <0, xx, yy>, 0.31 texture{tx_fosca} } } #local xx = xx + delta; #local i = i + 1; #end #end #macro grafico4(x0, g0, g1, g2, h1, h2, i1, i2, j1, j2, j3, x3, n) #local g3 = (g2 + h1)/2; #local h0 = g3; #local h3 = (h2 + i1)/2; #local i0 = h3; #local i3 = (i2 + j1)/2; #local j0 = i3; #local dist = (x3-x0)/4; grafico(x0, g0, g1, g2, g3, x0+dist, n) grafico(x0+dist, h0, h1, h2, h3, x0+2*dist, n) grafico(x0+2*dist, i0, i1, i2, i3, x0+3*dist, n) grafico(x0+3*dist, j0, j1, j2, j3, x0+4*dist, n) #end #macro interpola(f0, v0, f1, v1, f) #local ss = (f-f0)/(f1-f0); #local rr = 1 - ss; (rr*v0+ss*v1) #end #include "eixos.inc" // Aqui está a cena, finalmente: union { grafico4(0, -2, -5, 5 , -4, 4, -10, 10, 2, 3, 5, 10, 30) } #include "camlight.inc" #declare centro_cena = < 0.00, 3.00, 1.00 >; #declare raio_cena = 13.0; #declare dir_camera = < 14.00, 6.00, 6.00 >; #declare dist_camera = 32.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)