// Last edited on DATE TIME by USER // Processed by remove-cam-lights background{ color rgb < 0.4, 0.6, 0.8 > } #declare tx_1 = texture{ pigment{ color rgb < 0.99, 0.99, 0.99 > } } #declare tx_2 = texture{ pigment{ color rgb < 0.01, 0.01, 0.01 > } } #include "textures.inc" #declare semente1 = seed(45); #declare semente2 = seed(123); #declare semente3 = seed(1); #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 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); sphere{yy, 0.1 pigment{ color rgb < sqrt(2*i/N)*rand(semente1), sqrt(2*i/N)*rand(semente2), sqrt(2*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 curva_fechada(y0, y1, y2, y3, y4, y5, y6, y7, N) grafico4(0, (y7+y0)/2, y0, y1, y2, y3, y4, y5, y6, y7, (y7+y0)/2, 1, N) #end #macro posicao(y0, y1, y2, y3, y4, y5, y6, y7, tt) #if(tt<0) interpola4(0.75, (y6+y5)/2, y6, y7, (y7+y0)/2, 1,tt+1) #else #if(tt<0.25) interpola4(0,(y7+y0)/2, y0, y1, (y1+y2)/2, 0.25,tt) #else #if(tt<0.5) interpola4(0.25, (y2+y1)/2, y2, y3, (y4+y3)/2, 0.5,tt) #else #if(tt<0.75) interpola4(0.5, (y4+y3)/2, y4, y5, (y6+y5)/2, 0.75,tt) #else interpola4(0.75, (y6+y5)/2, y6, y7, (y7+y0)/2, 1,tt) #end #end #end #end #end #macro retalhos(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) union{ retalho (p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,(p31+p41)/2,(p32+p42)/2,(p33+p43)/2,(p34+p44)/2, rad,txr,txg) retalho ((p31+p41)/2,(p32+p42)/2,(p33+p43)/2,(p34+p44)/2,p41,p42,p43,p44,p51,p52,p53,p54,(p51+p61)/2,(p52+p62)/2,(p53+p63)/2,(p54+p64)/2, rad,txg,txr) retalho ((p51+p61)/2,(p52+p62)/2,(p53+p63)/2,(p54+p64)/2,p61,p62,p63,p64,p71,p72,p73,p74,p81,p82,p83,p84, rad,txr,txg) } #end #include "eixos.inc" #include "retalho.inc" union{ object{curva_fechada(<1,2,2>, <3,-2,0>, <4,0,-2>, <0,3,2>, <0,-2,-3>, <-1,2,-3>, <-2,-1,-1>, <-3,4,-1>, 150) translate<0,4,5>} object{sphere{posicao(<1,2,2>, <3,-2,0>, <4,0,-2>, <0,3,2>, <0,-2,-3>, <-1,2,-3>, <-2,-1,-1>, <-3,4,-1>, clock), 0.3} translate<0,4,5>} object{sphere{posicao(<1,2,2>, <3,-2,0>, <4,0,-2>, <0,3,2>, <0,-2,-3>, <-1,2,-3>, <-2,-1,-1>, <-3,4,-1>, clock-0.04), 0.3} translate<0,4,5>} object{sphere{posicao(<1,2,2>, <3,-2,0>, <4,0,-2>, <0,3,2>, <0,-2,-3>, <-1,2,-3>, <-2,-1,-1>, <-3,4,-1>, clock-0.08), 0.3} translate<0,4,5>} object{sphere{posicao(<1,2,2>, <3,-2,0>, <4,0,-2>, <0,3,2>, <0,-2,-3>, <-1,2,-3>, <-2,-1,-1>, <-3,4,-1>, clock-0.12), 0.3} translate<0,4,5>} retalhos( <0,0,3>,<1,0,3>,<2,0,2>,<3,0,2>,<0,1,3>,<1,1,3>,<2,1,2>,<3,1,2>,<0,3,3>,<1,3,3>,<2,3,2>,<3,3,2>, <1,5,4>,<2,5,4>,<3,4,1>,<4,4,1>,<0,7,5>,<1,7,5>,<2,5,2>,<3,5,2>,<-1,8,6>,<0,8,6>,<1,8,4>,<2,8,4>, <-1,9,6>,<0,9,6>,<1,9,4>,<2,9,4>,<-1,10,6>,<0,10,6>,<1,10,4>,<2,10,4>, 0.0001,tx_1,tx_2) } #include "camlight.inc" #declare centro_cena = < 1.00, 5.00, 0.00 >; #declare raio_cena = 12.0; #declare dir_camera = < 0.00, 1.00, 5.00 >; #declare dist_camera = 10.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , y, intens_luz)