// Last edited on 2019-07-17 01:27:30 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 } } #macro bola (raio, centro, textura) sphere{ centro, raio texture{ textura } } #end #declare bola_unit = sphere{ <0, 0, 0>, 0.1 texture{ tx_plastico_vermelho } } #declare x0 = -5; // posição final #declare x1 = 5; // posição inicial #macro circulo (raioS, raioC, start, stop, passo) union{ #for (i, start, stop, passo) #declare centro = raioC * <0, cos(2 * pi * i), sin(2 * pi * i)>; object{ bola(raioS, centro, tx_plastico_vermelho) } #end // end while } #end #macro palito (raio, p0, p1, passo) union{ #for (i, -1, 1, passo) #declare centro = p0 + i * p1; object{ bola(raio, centro, tx_plastico_vermelho) } #end // end while } #end #macro interplin (p0, t0, p1, t1, tt) #local r = (tt - t0) / (t1 - t0); #local s = 1 - r; #local vv = s * p0 + r * p1; vv #end // end interplin #macro bezier (t0, t1, A, B, C, D, tt) #local AB = interplin(A, t0, B, t1, tt); #local BC = interplin(B, t0, C, t1, tt); #local CD = interplin(C, t0, D, t1, tt); #local ABC = interplin(AB, t0, BC, t1, tt); #local BCD = interplin(BC, t0, CD, t1, tt); #local ABCD = interplin(ABC, t0, BCD, t1, tt); ABCD #end // end interplin #macro quadrado (passo) union{ #for (i, 0, 1, passo) object{ bola_unit translate interplin(<0, 0, 0>, 0, <0, 0, 1>, 1, i)} object{ bola_unit translate interplin(<0, 0, 0>, 0, <0, 1, 0>, 1, i)} object{ bola_unit translate interplin(<0, 1, 0>, 0, <0, 1, 1>, 1, i)} object{ bola_unit translate interplin(<0, 1, 1>, 0, <0, 0, 1>, 1, i)} #end // end while } #end #macro cubo (passo) union{ object{ quadrado(passo) } object{ quadrado(passo) translate <0, -1, 0> rotate <0, 0, 90> } object{ quadrado(passo) translate <1, -1, 0> rotate <0, 0, 90> } object{ quadrado(passo) translate <1, 0, 0> } } #end #include "eixos.inc" // object{ eixos(1.0) } #for (i, 0, 1, 0.01) object{ bola_unit translate bezier(0, 1, <0.5, 0.5, 0>, <0, -1, 1.5>, <1.5, -1, 0>, <0, 0, 0>, i) } object{ bola_unit translate bezier(0, 1, <0, 0, 0>, <0, 1.0, 1.0>, <1.0, 1.0, 1.0>, <0.3, -0.7, 0.2>, i) } object{ bola_unit translate bezier(0, 1, <0.5, 0.5, 0>, <0.25, 0.2, -0.8>, <0, 0.6, -0.8>, <0.3, -0.7, 0.2>, i) } #end #include "camlight.inc" #declare centro_cena = < 0.3, 0.0, 0.3>; #declare raio_cena = 1.5; #declare dir_camera = < -30, -30, 30 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)