// ====================================================================== // 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; union { #while (i <= n) #local yy = interpola4(x0, y0, y1, y2, y3, x3, xx); sphere { yy, 0.31 } #local xx = xx + delta; #local i = i + 1; #end } #end #macro grafico4(x0, g1, g2, h1, h2, i1, i2, j1, j2, 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 j3 = (g1+j2)/2; #local g0 = j3; #local dist = (x3-x0)/4; union { 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 "retalho.inc" #include "eixos.inc" #macro retalho2(j1,j2,j3,j4,j5,j6,j7,j8,j9,j10,j11,j12, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, rad,txg1,txr1, txg2, txr2) #local j13 = (j9+k5)/2; #local k1 = j13; #local j14 = (j10+k6)/2; #local k2 = j14; #local j15 = (j11+k7)/2; #local k3 = j15; #local j16 = (j12+k8)/2; #local k4 = j16; retalho(j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15, j16, rad, txg1, txr1) retalho(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, rad, txg2, txr2) #end // Aqui está a cena, finalmente: union { object {grafico4(0, <2,-5,1>, <-4,5,7> , <-1, 4,-5>,<2,4, -3>, <5,4,4>, <3,-5,1>, <1,-2,4>,<3,1,-3>, 10, 30) texture{tx_fosca} translate <-2, 0, 0>} // retalho(<-12, -10, -7>, <-12, -3.3, -5>, <-12, 3.3, -3>, <-12, 10, -2>, <-5,-10,2>, <-5,-3.3, 3>,<-5,3.3,5>,<-5,10,-7>, <5,-10,-10>, <5,-3.3,-3>, <5,3.3,3>, <5,10,5>, <12,-10,5>, <12,-3.3,7>, <12,3.3,8>, <12,10,9>, 0.5, tx_fosca, tx_verde) retalho2(<0,0,0>,<0,1,0>,<0,2,0>,<0,3,0>,<1,0,3>,<1,1,3>,<1,2,3>,<1,3,3>,<2,0,-1>,<2,1,-1>,<2,2,-1>,<2,3,-1>, <7,0,-3>,<7,1,-3>,<7,2,-3>,<7,3,-3>,<10,0,1>,<10,1,1>,<10,2,1>,<10,3,1>,<5,0,4>,<5,1,4>,<5,2,4>,<5,3,4>, 0.1, tx_vidro, tx_verde, tx_vidro, tx_azul) } #include "camlight.inc" #declare centro_cena = < 2.00, 3.00, 2.00 >; #declare raio_cena = 16.0; #declare dir_camera = < 14.00, -60.00, 2.00 >; #declare dist_camera = 50.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)