// Textures background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_objetos = texture{ pigment{ color rgb < 0.10, 0.10, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_arestas = texture{ pigment{ color rgb < 0.0, 0.0, 0.0 > } finish{ diffuse 0.9 ambient 0.1 } } // Objetos #declare raio_esferas = 2.0; #declare grau_1 = sphere { < -3.00, +3.00, 0.00 >, raio_esferas } #declare grau_2 = union { sphere{ < -3.00, +3.00, 0.00 >, raio_esferas } cylinder{ < -3.00, +3.00, 0.00 >, < -3.00, +3.00, 6.00 >, raio_esferas } } #declare grau_3 = union { sphere{ < -3.00, +3.00, 0.00 >, raio_esferas } box { < -1.00, +1.00, 0.00 >, < -5.00, +5.00, 8.00 > // near lower left corner, far upper right corner } } // #declare grau_4 = // union { // prism { // conic_sweep // linear_spline // 0, 1, 5, // Height 1, Height 2, Number of Points // <3, 3>, <-3, 3>, <-3, -3>, <3, -3>, <3, 3> // // scale <1, 6, 1> // } // box { // < -3.00, -3.00, 1.00 >, < +3.00, +3.00, 2.00 > // near lower left corner, far upper right corner // } // } #declare chao = box{ <-100,-100,-1>, <+100,+100,0> } // Macros #macro interpola1(ti, t0, v0, t1, v1) #local ss = (ti - t0)/(t1 - v1); #local vv = ((1 - ss) * v0) + (ss * v1); vv #end #macro interpola3(ti, ta, tb, v0, v1, v2, v3) #local v01 = interpola1(ti, ta, v0, tb, v1); #local v02 = interpola1(ti, ta, v1, tb, v2); #local v03 = interpola1(ti, ta, v2, tb, v3); #local v012 = interpola1(ti, ta, v01, tb, v02); #local v123 = interpola1(ti, ta, v02, tb, v03); #local v0123 = interpola1(ti, ta, v012, tb, v123); v0123 #end #macro test_interpola(p0, p1, p2, p3, n, raio) union{ #local k = 0; #while (k < n) #local centro = interpola3(k, 0, n, p0, p1, p2, p3); sphere{ centro, raio texture{ tx_arestas } } #local k = k + 1; #end } #end #include "eixos.inc" // Cena union{ object{ eixos(3.00) } object{ grau_2 texture {tx_objetos} rotate <180, 0, 0> // translate <20, 0, 10> // } object{ grau_3 texture {tx_objetos} rotate <180, 0, 0> // translate <-20, 0, -10> // } test_interpola(<-20, 0, -10>, <-10, +3, -5>, <+10, -3, +5>, <+20, 0, +10>, 50, 0.5) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 40.0; #declare dir_camera = < 9.00, 7.00, 9.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)