// Last edited on DATE TIME by USER // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_1 = texture{ pigment{ color rgb < 0.70, 0.80, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_2 = texture{ pigment{ color rgb < 0.30, 0.50, 0.70 > } finish{ diffuse 0.9 ambient 0.1 } } #include "retalho.inc" #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,y0,y1,y2,y3, t3, tt) #local y01 = interpola(t0, y0, t3, y1, tt); #local y12 = interpola(t0, y1, t3, y2, tt); #local y23 = interpola(t0, y2, t3, y3, tt); #local y012 = interpola(t0, y01, t3, y12, tt); #local y123 = interpola(t0, y12, t3, y23, tt); #local y01234 = interpola(t0, y012, t3, y123, tt); interpola(t0, y012, t3, y01234, tt); #end #macro desenha(a0, b0, b1, b2, b3, a3, n, fase) #local yy = interpola4(a0, b0, b1, b2, b3, a3, fase); object { sphere{yy, 0.5 texture{tx_1} } } #end #macro desenhaantigo(a0, b0, b1, b2, b3, a3, n) #local delta = (a3-a0)/n; #local i = 0; #local xx = a0; #while(i < n) #local yy = interpola4(a0, b0, b1, b2, b3, a3, xx); object { sphere{yy, 0.2 texture{tx_2} } } #local xx = xx + delta; #local i = i + 1; #end #end #macro desenha4antigo(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 g0 = (g1+j2)/2; #local j3 = g0; #local dt = (x3-x0)/4; desenhaantigo(x0, g0, g1, g2, g3, x0+dt, n) desenhaantigo(x0+dt, h0, h1, h2, h3, x0+2*dt, n) desenhaantigo(x0+2*dt, i0, i1, i2, i3, x0+3*dt, n) desenhaantigo(x0+3*dt, j0, j1, j2, j3, x0+4*dt, n) #end #macro desenha4(x0, g1, g2, h1, h2, i1, i2, j1, j2, x3, n, fase) #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 g0 = (g1+j2)/2; #local j3 = g0; #local dt = (x3-x0)/4; #if(fase < 0.25) desenha(0, g0, g1, g2, g3, 0.25, n, fase) #else #if(fase < 0.5) desenha(0.25, h0, h1, h2, h3, 0.5, n, fase) #else #if(fase < 0.75) desenha(0.5, i0, i1, i2, i3, 0.75, n, fase) #else #if(fase < 1) desenha(0.75, j0, j1, j2, j3, 1, n, fase) #end #end #end #end #end #macro junta(p11,p12,p13,p14, p21,p22,p23,p24, p31,p32,p33,p34, p41,p42,p43,p44, p51,p52,p53,p54, p61,p62,p63,p64, p71,p72,p73,p74, p81,p82,p83,p84, rad,txg,txr) #local pp1 = (p31+p41)/2; #local pp2 = (p32+p42)/2; #local pp3 = (p33+p43)/2; #local pp4 = (p34+p44)/2; #local pp5 = (p51+p61)/2; #local pp6 = (p52+p62)/2; #local pp7 = (p53+p63)/2; #local pp8 = (p54+p64)/2; union{ retalho(p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,pp1,pp2,pp3,pp4,rad,txg,txr) retalho(pp1,pp2,pp3,pp4,p41,p42,p43,p44,p51,p52,p53,p54,pp5,pp6,pp7,pp8,rad,txr,txg) retalho(pp5,pp6,pp7,pp8,p61,p62,p63,p64,p71,p72,p73,p74,p81,p82,p83,p84,rad,txg,txr) translate <0, 7, 0> } #end union{ junta(<0,-4,0>, <1,-3.75,0>, <0,-3.5,0>, <2,-3.25,0>, <0,-3,0>, <1,-2.75,0>, <0,-2.5,0>, <2,-2.25,0>, <0,-2,1>, <1,-1.75,1>, <0,-1.5,1>, <2,-1.25,1>, <0,-1,2>, <1,-0.75,2>, <0,-0.5,2>, <2,-0.25,2>, <0,0,1>, <1,0.25,1>, <0,0.5,1>, <2,0.75,1>, <0,1,0>, <1,1.25,0>, <0,1.5,0>, <2,1.75,0>, <0,2,1>, <1,2.25,1>, <0,2.5,1>, <2,2.75,1>, <0,3,2>, <1,3.25,2>, <0,3.5,2>, <2,3.75,2>, 0.0001, tx_2, tx_1) desenha4(0, <5,5,-4>, <4,5,6>, <3,8,7>, <-4,4,9>, <-7,7,8>, <-8,-5,8>, <-9,-8,6>, <-5,-5,-5>, 8, 120, clock) desenha4antigo(0, <5,5,-4>, <4,5,6>, <3,8,7>, <-4,4,9>, <-7,7,8>, <-8,-5,8>, <-9,-8,6>, <-5,-5,-5>, 8, 120) } #include "camlight.inc" #declare centro_cena = < 2, 5, 4 >; #declare raio_cena = 15.0; #declare dir_camera = < 50.00, 10.00, 30.00 >; #declare dist_camera = 40.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)