// CORES E TEXTURAS #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } background{ color rgb < 0.75, 0.80, 0.85 > } // DESCRIÇÃO DA CENA #macro CriaCurva(raio) #declare curva = spline { natural_spline -0.25, < 0.0,-5.0,-1.0>, 0.00, < 0.0, 0.0, 0.0>, 0.25, < 0.0, 5.0, 4.0>, 0.50, < 1.5, 6.0,12.0>, 0.75, < 8.0, 4.0,18.5>, 1.00, <15.0, 5.0,20.0>, 1.25, <20.0, 5.0,19.4> } #end #macro palito(R, N, p, q, uu) #local dx = q.x - p.x; #local dy = q.y - p.y; #local m = dy/dx; #local dist = sqrt(pow(dx, 2.0) + pow(dy, 2.0)); #local points = dist/(m*uu); #local curva = spline { natural_spline #local i = 0; #while (i <= points) i, , #local i = i + uu; #end } #local palto = union { #local i = 0; #while (i < points) sphere{ <0,0,0>, R pigment{ color rgb<1,0.3,0>} translate curva(i) } #declare i = i + uu; #end } palto #end #macro CriaNo(n_voltas, raio_corda, espacamento_entre_bolas) #declare uu = 0.1; #declare bolas = 10; #declare p = <0.5, 0.8,0>; #declare q = <0.7, 0.9,0>; #declare palitos = array[2]; #declare palitos[0] = palito(1, 10, p, q, uu); #declare palitos[1] = palito(1, 10, < 0.5, 0.8, 0>, <1, 1.5, 0>, uu); union { #declare i = 0; #while (i < 2) object { palitos[i] } #declare i = i + 1; #end } #end CriaNo(5, 1, 1) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 30.0; #declare dir_camera = < 10.00, 10.00, 10.00 >; #declare dist_camera = 2*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)