// Last edited on DATE TIME by USER // Processed by remove-cam-lights #include "retalho.inc" background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_branco = texture{ pigment{ color rgb < 1, 1, 1 > } } #declare tx_fosca_marrom = texture{ pigment{ color rgb < 0.361, 0.2, 0.09 > } } #declare tx_olhos = texture{ pigment{ color rgb < 0.10, 0.62, 0.10 >} finish{ diffuse 0.9 ambient 0.5 } } #declare retalho1 = array[12] #declare retalho1[0] = <0,0,0>; #declare retalho1[1] = <1,0,0>; #declare retalho1[2] = <2,0,0>; #declare retalho1[3] = <3,0,0>; #declare retalho1[4] = <0,1,0>; #declare retalho1[5] = <1,1,0>; #declare retalho1[6] = <2,1,0>; #declare retalho1[7] = <3,1,0>; #declare retalho1[8] = <0,2,1>; #declare retalho1[9] = <1,2,1>; #declare retalho1[10] = <2,2,3>; #declare retalho1[11] = <3,2,1>; #declare retalho2 = array[12] #declare retalho2[0] = <0,4,1>; #declare retalho2[1] = <1,4,4>; #declare retalho2[2] = <2,4,3>; #declare retalho2[3] = <3,4,0>; #declare retalho2[4] = <0,5,0>; #declare retalho2[5] = <1,5,0>; #declare retalho2[6] = <2,5,0>; #declare retalho2[7] = <3,5,0>; #declare retalho2[8] = <0,6,0>; #declare retalho2[9] = <1,6,0>; #declare retalho2[10] = <2,6,0>; #declare retalho2[11] = <3,6,0>; #declare emenda= array[4]; #declare emenda[0]= (retalho2[0]+retalho1[8])/2; #declare emenda[1]= (retalho2[1]+retalho1[9])/2; #declare emenda[2]= (retalho2[2]+retalho1[10])/2; #declare emenda[3]= (retalho2[3]+retalho1[11])/2; #declare N_Esferas = 100; #declare roleta = seed(500); #macro interpola (f0, v0, f1, v1, f) #local ss = abs(f-f0)/abs(f1-f0); #local rr = 1-ss; (rr*v0 + ss*v1) #end #macro interpola4 (t0, v0, v1, v2, v3, t1, tt) #local v01 = interpola(t0, v0, t1, v1, tt); #local v12 = interpola(t0, v1, t1, v2, tt); #local v23 = interpola(t0, v2, t1, v3, tt); #local v012 = interpola(t0, v01, t1, v12, tt); #local v123 = interpola(t0, v12, t1, v23, tt); #local v0123 = interpola(t0, v012, t1, v123, tt); v0123 #end #macro graficoPoint (x0, y0, y1, y2, y3, x3, N, clockValue) #if (x0 < x3) #local xmin = x0; #local xmax = x3; #else #local xmin = x3; #local xmax = x0; #end #local var = x0*(1-clockValue) + x3*clockValue; #local intervalo = (xmax-xmin)/N; #local yt = interpola4 (xmin, y0, y1, y2, y3, xmax, var); yt #end #macro grafico (x0, y0, y1, y2, y3, x3, N) #if (x0 < x3) #local xmin = x0; #local xmax = x3; #else #local xmin = x3; #local xmax = x0; #end #local var = xmin; #local intervalo = (xmax-xmin)/N; union { #while (var < xmax) #local yt = interpola4 (xmin, y0, y1, y2, y3, xmax, var); object { sphere{ yt, 0.1 } } #local var = var + intervalo; #end } #end #macro posicao (clockValue) #if(clock<=0.25) #local pointReturn =graficoPoint(0 *1.0, (y2d+y1a)/2 *1.0, y1a *1.0, y2a *1.0, (y2a+y1b)/2 *1.0, 1 *1.0, N_Esferas, (clockValue-0)/0.25 ) ; #end #if(clock>0.25 & clock <=0.5) #local pointReturn =graficoPoint(1 *1.0, (y2a+y1b)/2 *1.0, y1b *1.0, y2b *1.0, (y2b+y1c)/2 *1.0, 2 *1.0, N_Esferas, (clockValue-0.25)/0.25) ; #end #if(clock>0.5 & clock <=0.75) #local pointReturn =graficoPoint(2 *1.0, (y2b+y1c)/2 *1.0, y1c *1.0, y2c *1.0, (y2c+y1d)/2 *1.0, 3 *1.0, N_Esferas, (clockValue-0.5)/0.25) ; #end #if(clock>0.75) #local pointReturn =graficoPoint(3 *1.0, (y2c+y1d)/2 *1.0, y1d *1.0, y2d *1.0, (y2d+y1a)/2 *1.0, 4 *1.0, N_Esferas, (clockValue-0.75)/0.25) ; #end pointReturn #end #include "eixos.inc" union { object { eixos (10)} #local y1a = <0,5,10>; #local y2a = <1,6,9>; #local y1b = <0,0,4>; #local y2b = <3,4,4>; #local y1c = <6,10,10>; #local y2c = <10,10,1>; #local y1d = <1,10,1>; #local y2d = <3,3,3>; object{ sphere{posicao(clock) , 0.2} translate <5,0,0>} object{union{ object {grafico(0 *1, (y2d+y1a)/2 *1, y1a *1, y2a *1, (y2a+y1b)/2 *1, 1 *1, N_Esferas) texture {tx_fosca_marrom}} object {grafico(1 *1, (y2a+y1b)/2 *1, y1b *1, y2b *1, (y2b+y1c)/2 *1, 2 *1, N_Esferas) texture {tx_olhos}} object {grafico(2 *1, (y2b+y1c)/2 *1, y1c *1, y2c *1, (y2c+y1d)/2 *1, 3 *1, N_Esferas) texture {tx_fosca_marrom}} object {grafico(3 *1, (y2c+y1d)/2 *1, y1d *1, y2d *1, (y2d+y1a)/2 *1, 4 *1, N_Esferas) texture {tx_olhos}} } translate <5,0,0>} object {retalho (retalho1[0],retalho1[1],retalho1[2],retalho1[3], retalho1[4],retalho1[5],retalho1[6],retalho1[7], retalho1[8],retalho1[9],retalho1[10],retalho1[11], emenda[0],emenda[1],emenda[2],emenda[3], 0.05,tx_fosca_marrom,tx_olhos) } object {retalho (emenda[0],emenda[1],emenda[2],emenda[3], retalho2[0],retalho2[1],retalho2[2],retalho2[3], retalho2[4],retalho2[5],retalho2[6],retalho2[7], retalho2[8],retalho2[9],retalho2[10],retalho2[11], 0.05,tx_fosca_marrom,tx_fosca) } } #include "camlight.inc" #declare centro_cena = < 5.00, 5.00, 5.00 >; #declare raio_cena = 15.0; #declare dir_camera = < 1, 1, 1 >; #declare dist_camera = 30.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , y, intens_luz)