// Last edited on 2019-07-17 05:24:39 by stolfilocal // Processed by remove-cam-lights 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 ponto = sphere{<0, 0, 0>, 0.1 texture{ tx_fosca }} #include "eixos.inc" #macro interp1Matriz (P, Q, N, c0, c1, cc, R) #for (i, 0, N-1, 1) #for (k, 0, 3, 1) #declare R[i][k] = interp1(P[i][k], Q[i][k], c0, c1, cc); #end #end #end #macro interp1 (v0, v1, t0, t1, tt) #local rr = (tt - t0) / (t1 - t0); #local ss = 1 - rr; #local vv = ss * v0 + rr * v1; vv #end #macro interpola3 (A, B, C, D, t0, t1, tt) #local AB = interp1(A, B, t0, t1, tt); #local BC = interp1(B, C, t0, t1, tt); #local CD = interp1(C, D, t0, t1, tt); #local ABC = interp1(AB, BC, t0, t1, tt); #local BCD = interp1(BC, CD, t0, t1, tt); #local ABCD = interp1(ABC, BCD, t0, t1, tt); ABCD #end #macro noh(P,N,tt) union{ #for (j, 0, N-1, 1) #for (i, 0, 1, tt) object{ ponto translate interpola3(P[j][0], P[j][1], P[j][2], P[j][3], 0, 1, i) } #end #end } #end //object{ eixos(3.00) translate < 0,0,0 > } //object{ eixos(1.0) } #declare P = array[4][4]; #declare P[0][0] = <0, -1, -1>; #declare P[0][1] = <0, 0, 0>; #declare P[0][2] = <0, 0, 0>; #declare P[0][3] = <0, 1, -1>; #declare P[1][0] = <0, 1, -1>; #declare P[1][1] = <0, 0, 0>; #declare P[1][2] = <0, 0, 0>; #declare P[1][3] = <0, 1, 1>; #declare P[2][0] = <0, 1, 1>; #declare P[2][1] = <0, 0, 0>; #declare P[2][2] = <0, 0, 0>; #declare P[2][3] = <0, -1, 1>; #declare P[3][0] = <0, -1, 1>; #declare P[3][1] = <0, 0, 0>; #declare P[3][2] = <0, 0, 0>; #declare P[3][3] = <0, -1, -1>; #declare Q = array[4][4]; #declare Q[0][0] = <0, 1, 0>; #declare Q[0][1] = <0, 0, 0>; #declare Q[0][2] = <0, 0, 0>; #declare Q[0][3] = <0, 0, 1>; #declare Q[1][0] = <0, 0, 1>; #declare Q[1][1] = <0, 0, 0>; #declare Q[1][2] = <0, 0, 0>; #declare Q[1][3] = <0, -1, 0>; #declare Q[2][0] = <0, -1, 0>; #declare Q[2][1] = <0, 0, 0>; #declare Q[2][2] = <0, 0, 0>; #declare Q[2][3] = <0, 0, -1>; #declare Q[3][0] = <0, 0, -1>; #declare Q[3][1] = <0, 0, 0>; #declare Q[3][2] = <0, 0, 0>; #declare Q[3][3] = <0, 1, 0>; #declare R = array[4][4]; #for (i, 0, 3, 1) #for (k, 0, 3, 1) #declare R[i][k] = <0,0,0>; #end #end noh(P, 4, 0.001) interp1Matriz (P, Q, 4, 0, 1, 0.25, R) object{ noh(R, 4, 0.001) translate < 0,2,0 >} interp1Matriz (P, Q, 4, 0, 1, 0.5, R) object{ noh(R, 4, 0.001) translate < 0,4,0 >} interp1Matriz (P, Q, 4, 0, 1, 0.75, R) object{ noh(R, 4, 0.001) translate < 0,6,0 >} object{ noh(Q, 4, 0.001) translate < 0,8,0 >} #include "camlight.inc" #declare centro_cena = < 0, 4, 0>; #declare raio_cena = 8.0; #declare dir_camera = < 45, 20, 5 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)