// Last edited on 2019-07-17 07:41:15 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare Yellow = rgb<255, 255, 0>; #declare Black = rgb < 0.4, 0.4, 0.4 >; #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_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare esfera = sphere { < 0, 0, 0>, 0.25 // Near lower left corner texture{ tx_fosca } } #include "eixos.inc" // object{ eixos(3.00) } #declare P = array[4][4]; #declare P[0][0] = <0,0,0>; #declare P[0][1] = <0,-1,-1>; #declare P[0][2] = <0,-2,-2>; #declare P[0][3] = <0,-3,0>; #declare P[1][0] = <0,-3,0>; #declare P[1][1] = <1,-3,1>; #declare P[1][2] = <1,-1,2>; #declare P[1][3] = <2,0,5>; #declare P[2][0] = <2,0,5>; #declare P[2][1] = <1,1,3>; #declare P[2][2] = <0,3,4>; #declare P[2][3] = <0,7,1>; #declare P[3][0] = <0,7,1>; #declare P[3][1] = <-1,5,1>; #declare P[3][2] = <-1,2,0>; #declare P[3][3] = <0,0,0>; #macro interpola(to, vo, t1, v1, tt ) #local r = (tt-to)/(t1-to); #local s = 1-r; #local vv= s*vo+r*v1; vv #end #macro arcobezier(to, t1, a, b, c, d, tt ) #local ab = interpola(to, a, t1, b, tt ); #local bc = interpola(to, b, t1, c, tt ); #local cd = interpola(to, c, t1, d, tt ); #local abc = interpola(to, ab, t1, bc, tt ); #local bcd = interpola(to, bc, t1, cd, tt ); #local abcd = interpola(to, abc, t1, bcd, tt ); abcd #end #macro arco(a0, a1, a2, a3, t0, t1, n) union{ #declare passo = 1/n; #declare j = t0; #while (j <= t1) object { esfera translate arcobezier(t0,t1, a0, a1, a2, a3, j)} #declare j=j+passo; #end } #end #macro suaviza(i) #local j = mod(i+1, 4); #local vv = (P[j][1]-P[i][2])/2; #declare P[i][2]= P[i][3]-vv; #declare P[j][1]= P[j][0]+vv; #end #macro poliArcos(n,l) #local i = 0; #while(i < 4 ) suaviza(i) #local i = i+1; #end union{ #declare lado = n/l; object {arco (P[0][0], P[0][1], P[0][2], P[0][3], 0, lado, n) } object {arco (P[1][0], P[1][1], P[1][2], P[1][3], lado, 2*lado, n) } object {arco (P[2][0], P[2][1], P[2][2], P[2][3], 2*lado, 3*lado, n) } object {arco (P[3][0], P[3][1], P[3][2], P[3][3], 3*lado, 4*lado, n) } } #end #macro noh(P1, n, m) union{ #declare lado = n/m; object {arco (P[0][0], P1[0][1], P1[0][2], P1[0][3], 0, lado, m) } object {arco (P1[1][0], P1[1][1], P1[1][2], P1[1][3], lado, 2*lado, m) } object {arco (P1[2][0], P1[2][1], P1[2][2], P1[2][3], 2*lado, 3*lado, m) } object {arco (P1[3][0], P1[3][1], P1[3][2], P1[3][3], 3*lado, 4*lado, m) } } #end #macro suaviza(i) #local j = mod(i+1, 4); #local vv = (P[j][1]-P[i][2])/2; #declare P[i][2]= P[i][3]-vv; #declare P[j][1]= P[j][0]+vv; #end #macro interpola3 (A, B, C, D, t0, t1, tt) #local AB = interpola(A, b, t0, t1, tt); #local BC = interpola(B, C, t0, t1, tt); #local CD = interpola(C, D, t0, t1, tt); #local ABC = interpola(AB, BC, t0, t1, tt); #local BCD = interpola(BC, CD, t0, t1, tt); #local ABC = interpola(BC, CD, t0, t1, tt); #local ABCD = interpola(ABC, BCD, t0, t1, tt); ABCD #end object{poliArcos(20, 4)} #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 10.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)