// Last edited on 2019-07-17 05:19:09 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico_branco = texture{ pigment{ color rgb < 1.0, 1.0, 1.0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_preto = texture{ pigment{ color rgb < 0.0, 0.0, 0.0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_vermelho = texture{ pigment{ color rgb < 0.90, 0.20, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_azul = texture{ pigment{ color rgb < 0.1, 0.2, 0.9 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare bola_unit = sphere{ <0, 0, 0>, 0.1 texture{ tx_plastico_vermelho } } #macro interplin (p0, p1, t0, t1, tt) #local r = (tt - t0) / (t1 - t0); #local s = 1 - r; #local vv = s * p0 + r * p1; vv #end // end interplin #macro interp_matriz (P, Q, N, M, t0, t1, tt, R) #for (j, 0, N - 1) #for (i, 0, M - 1) #declare R[j][i] = interplin(P[j][i], Q[j][i], t0, t1, tt); #end // for i #end // for j #end // end interp_matriz #macro bezier (A, B, C, D, t0, t1, tt) #local AB = interplin(A, B, t0, t1, tt); #local BC = interplin(B, C, t0, t1, tt); #local CD = interplin(C, D, t0, t1, tt); #local ABC = interplin(AB, BC, t0, t1, tt); #local BCD = interplin(BC, CD, t0, t1, tt); #local ABCD = interplin(ABC, BCD, t0, t1, tt); ABCD #end // end bezier #macro suavizaX(P, N, i) #local j = mod(i + 1, N); #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 // end suavizaX #macro noh(P, Na, Ne) union { #for (j, 0, Na - 1) #for (i, 0, 1, 1 / Ne) object{ bola_unit translate bezier(P[j][0], P[j][1], P[j][2], P[j][3], 0, 1, i) } #end #end } #end // end no #declare P = array[6][4]; #declare P[0][0] = <-1, -1, -0.5>; #declare P[0][1] = <-0.75, -0.75, -0.2>; #declare P[0][2] = <0.3, 0, 0.75>; #declare P[0][3] = <0.75, 0.75, 0.5>; #declare P[1][0] = <0.75, 0.75, 0.5>; #declare P[1][1] = <0.55, 0.55, 0.2>; #declare P[1][2] = <0.3, 0.3, -0.5>; #declare P[1][3] = <0, 0, -0.75>; #declare P[2][0] = <0, 0, -0.75>; #declare P[2][1] = <-0.3, -0.3, -0.5>; #declare P[2][2] = <-0.55, -0.55, 0.2>; #declare P[2][3] = <-0.75, -0.75, 0.5>; #declare P[3][0] = <-0.75, -0.75, 0.5>; #declare P[3][1] = <-3, 0, 0.75>; #declare P[3][2] = <0.75, 0.75, -0.2>; #declare P[3][3] = <1, 1, -0.5>; #declare P[4][0] = <-1, -1, -0.5>; #declare P[4][1] = <-0.85, -0.85, 0.7>; #declare P[4][2] = <-0.75, -0.75, 0.9>; #declare P[4][3] = <0, 0, 1.0>; #declare P[5][0] = <1, 1, -0.5>; #declare P[5][1] = <0.85, 0.85, 0.7>; #declare P[5][2] = <0.75, 0.75, 0.9>; #declare P[5][3] = <0, 0, 1.0>; suavizaX(P, 6, 0) suavizaX(P, 6, 1) suavizaX(P, 6, 2) suavizaX(P, 6, 3) suavizaX(P, 6, 4) suavizaX(P, 6, 5) #declare P2 = array[6][4]; #declare P2[0][0] = 0.5 * <-1, -1, -0.5>; #declare P2[0][1] = 0.5 * <-0.75, -0.75, -0.2>; #declare P2[0][2] = 0.5 * <0.3, 0, 0.75>; #declare P2[0][3] = 0.5 * <0.75, 0.75, 0.5>; #declare P2[1][0] = 0.5 * <0.75, 0.75, 0.5>; #declare P2[1][1] = 0.5 * <0.55, 2.55, 0.2>; #declare P2[1][2] = 0.5 * <0.3, 0.3, -0.5>; #declare P2[1][3] = 0.5 * <0, 0, -0.75>; #declare P2[2][0] = 0.5 * <0, 0, -0.75>; #declare P2[2][1] = 0.5 * <-0.3, -0.3, -0.5>; #declare P2[2][2] = 0.5 * <-0.55, -0.55, 0.2>; #declare P2[2][3] = 0.5 * <-0.75, -0.75, 0.5>; #declare P2[3][0] = 0.5 * <-0.75, -0.75, 0.5>; #declare P2[3][1] = 0.5 * <-3, 0, 0.75>; #declare P2[3][2] = 0.5 * <1.75, -0.75, -4.2>; #declare P2[3][3] = 0.5 * <1, 1, -0.5>; #declare P2[4][0] = 0.5 * <-1, -1, -0.5>; #declare P2[4][1] = 0.5 * <-0.85, -0.85, 0.7>; #declare P2[4][2] = 0.5 * <-1.75, -3.75, 0.9>; #declare P2[4][3] = 0.5 * <0, 0, 1.0>; #declare P2[5][0] = 0.5 * <1, 1, -0.5>; #declare P2[5][1] = 0.5 * <0.85, 0.85, 0.7>; #declare P2[5][2] = 0.5 * <0.75, 0.75, 0.9>; #declare P2[5][3] = 0.5 * <0, 0, 1.0>; suavizaX(P2, 6, 0) suavizaX(P2, 6, 1) suavizaX(P2, 6, 2) suavizaX(P2, 6, 3) suavizaX(P2, 6, 4) suavizaX(P2, 6, 5) #declare R = array[6][4]; #for (j, 0, 6 - 1) #for (i, 0, 4 - 1) #declare R[j][i] = <0, 0, 0>; #end // for i #end // for j object{ noh(P, 6, 40) translate <0, -4, -2> } interp_matriz(P, P2, 6, 4, 0, 1, 0.25, R) object{ noh(R, 6, 40) translate <0, -2, -1> } interp_matriz(P, P2, 6, 4, 0, 1, 0.5, R) object{ noh(R, 6, 40) translate <0, 0, 0> } interp_matriz(P, P2, 6, 4, 0, 1, 0.75, R) object{ noh(R, 6, 40) translate <0, 2, 1> } object{ noh(P2, 6, 40) translate <0, 4, 2> } #include "eixos.inc" //object{ eixos(1.0) } #include "camlight.inc" #declare centro_cena = < 0.0, 0.0, 0.0>; #declare raio_cena = 7.0; #declare dir_camera = < 45, 0, 0 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)