// Last edited on 2019-07-17 05:45:18 by stolfilocal // Processed by remove-cam-lights #declare tx_fosca = texture{ pigment{ color rgb < 1, 1, 1 > } finish{ diffuse 0.9 ambient 0.1 } } #declare N = 4; #declare P = array[N][4]; #declare P[0][0] = <0, 0, 0>; #declare P[0][1] = <0, 1, 1.1>; #declare P[0][2] = <0, -2, 0.5>; #declare P[0][3] = <0, 0, 3>; #declare P[1][0] = <0, 0, 3>; #declare P[1][1] = <0, 1, -1>; #declare P[1][2] = <0,3, 0>; #declare P[1][3] = <0, 3.1, 2>; #declare P[2][0] = <0, 3.1, 2>; #declare P[2][1] = <0, 3, 1>; #declare P[2][2] = <0, 1, 0.5>; #declare P[2][3] = <0, 2, 0>; #declare P[3][0] = <0, 2, 0>; #declare P[3][1] = <0, -2, 0>; #declare P[3][2] = <0, -1,2>; #declare P[3][3] = <0, 0,0>; #declare Q = array[N][4]; #declare Q[0][0] = <0, 3,-1>; #declare Q[0][1] = <0, 0,0>; #declare Q[0][2] = <0, 1,0.5>; #declare Q[0][3] = <0,-2,1>; #declare Q[1][0] = <0,-2,1>; #declare Q[1][1] = <0, 1,4>; #declare Q[1][2] = <0,-1,0>; #declare Q[1][3] = <0, 4,4>; #declare Q[2][0] = <0, 4,4>; #declare Q[2][1] = <0, 3, 1>; #declare Q[2][2] = <0, 1, 0.5>; #declare Q[2][3] = <0, 2,-1>; #declare Q[3][0] = <0, 2, -1>; #declare Q[3][1] = <0, -1, 0>; #declare Q[3][2] = <0, 0, -1>; #declare Q[3][3] = <0, 0, 0>; #macro interpol(t0, v0, t1, v1, tt) #local r = (tt - t0) / (t1 - t0); #local s = 1 - r; #local vv = s * v0 + r * v1; #local returnX = s * v0.x + r * v1.x; #local returnY = s * v0.y + r * v1.y; #local returnZ = s * v0.z + r * v1.z; #end #macro arcoBezier(t0, t1, A, B, C, D, tt) #local AB = interpol(t0, A, t1, B, tt); #local BC = interpol(t0, B, t1, C, tt); #local CD = interpol(t0, C, t1, D, tt); #local ABC = interpol(t0, AB, t1, BC, tt); #local BCD = interpol(t0, BC, t1, CD, tt); #local ABCD = interpol(t0, ABC, t1, BCD, tt); ABCD #end #include "eixos.inc" #macro matrizinterpola(P, Q, N, c0, c1, cc, R) #for(i, 0, N - 1, 1) #for(j, 0, 4 - 1, 1) #local R[i][j] = interpol(c0, P[i][j], c1, Q[i][j], cc); #end #end #end #macro noh(L,N,M) union{ #local bolinha = sphere{ < 0.00, 0.00, 0.00 >,0.1 texture{ tx_fosca } } #for (j, 0, N-1, 1) #for(i, 0, 1, 0.001) #local A = L[j][0]; #local B = L[j][1]; #local C = L[j][2]; #local D = L[j][3]; object {bolinha translate arcoBezier(0,1,A,B,C,D,i) texture{tx_fosca}} #end #end } #end union{ #declare R = array[N][4]; #for(m,0,N-1,1) #for(n,0,3,1) #declare R[m][n] = <0,0,0>; #end #end #for (cc,0,1,0.2) matrizinterpola(P,Q,N,0,1,cc,R) object{noh(R,N,100) translate 5.0*cc*x } #end } #include "eixos.inc" //object{eixos(1)} #include "camlight.inc" #declare centro_cena = < 2,0,0>; #declare raio_cena = 6; #declare dir_camera = < 2,3,1 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)