// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.5, 0.5, 0.85 > } #declare cor_bola = texture{ pigment{ color rgb < 0.50, 0.60, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRICAO DA CENA #declare passos = 100; #declare vet = array[12]; // DECLARACAO DOS PONTOS NO ARRAY #macro interpolin(t0, v0, t1, v1, tt) #local r = (tt-t0)/(t1-t0); #local s = 1-r; #local vv = s*v0 + r*v1; vv #end #macro arcobezier(t0, t1, A, B, C, D, tt) #local AB = interpolin(t0, A, t1, B, tt); #local BC = interpolin(t0, B, t1, C, tt); #local CD = interpolin(t0, C, t1, D, tt); #local ABC = interpolin(t0, AB, t1, BC, tt); #local BCD = interpolin(t0, BC, t1, CD, tt); #local ACBD = interpolin(t0, ABC, t1, BCD, tt); ACBD #end #macro curva(p0, p1, v0, v1) #local i = 0; #while(i <= passos) #local p = arcobezier(0, passos, p0, v0, v1, p1, i); sphere{ p, 0.5 texture{cor_bola}} #declare i = i+1; #end //cylinder{ t0, t1, 0.5 texture{cor_bola}} #end // Cena final union{ curva(<0.5, 5, 0>, <13.5, 9.5, 0>, <3.5, 7, 0>, <11.5, 7, 0>) curva(<13.5, 9.5, 0>, <8.5, 6, 0>, <13, 11, 0>, <8, 9.5, 0>) curva(<8.5, 6, 0>, <6.5, 11, 0>, <7.5, 0, 0>, <6, 2, 0>) curva(<6.5, 11, 0>, <0.5, 5, 0>, <11, 8, 0>, <4, 0.5, 0>) } /* #declare i = 0; union{ #while(i<11) #if (i+3 == curva(vet[i],vet[i+3],vet[i+1],vet[i+2]) #declare i=i+1; */ #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 20.0; #declare dir_camera = < 7.00, 7.00, 5.0 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)