// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-02 22:43:04 by stolfilocal // ====================================================================== // CORES E TEXTURAS //#include "textures.inc" background{ color rgb < 240/255, 243/255, 246/255 > } #declare tx_chao = texture{ pigment{ color rgb < 0.90, 0.95, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_ponto = texture{ pigment{ color rgb < 0.97, 0.87, 0.17 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #declare tx_grau1 = texture{ pigment{ color rgb < 0.17, 0.80, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #declare tx_grau2 = texture{ pigment{ color rgb < 0.80, 0.17, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #declare tx_grau3 = texture{ pigment{ color rgb < 0.10, 1.00, 0.17 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #declare tx_grau4 = texture{ pigment{ color rgb < 1.00, 0.17, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #declare tx_tubo = texture{ pigment{ color rgb < 0.20, 0.07, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } //------------------------------------------------------------------ #declare A = array[10000] #declare N = 0; #declare roleta1 = seed(92839); //-------------------------------------------------------------- #macro ponto(centro, raio) union{ sphere{ centro, raio texture{ tx_ponto } } } #end #macro grau1(i, j) union{ sphere{ < i, j, 0.25 >, 0.25 texture{ tx_grau1 } } cylinder{ < i, j, 0.25 >, < i + 0.35, j, 0.25 >, 0.1 texture{ tx_tubo } } // #declare A[N] = < i - 0.5 + 0.35, j - 0.5, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5, j - 0.5 + 0.35, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5 - 0.35, j - 0.5, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5, j - 0.5 - 0.35, 0.75 >; // #declare N = N + 1; } // tq #end #macro grau2(i, j) union{ cylinder{ < i, j, 0 >, < i, j, 0.25>, 0.35 texture{ tx_grau2 } } box{ < i - 0.2, j - 0.2, 0.25>, < i + 0.2, j + 0.2, 0.75 > texture{ tx_grau2 } } cylinder{ < i, j, 0.5 >, < i + 0.5, j, 0.5 >, 0.1 texture{ tx_tubo } } cylinder{ < i, j, 0.5 >, < i - 0.5, j, 0.5 >, 0.1 texture{ tx_tubo } } // #declare A[N] = < i - 0.5 + 0.35, j - 0.5, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5, j - 0.5 + 0.35, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5 - 0.35, j - 0.5, 0.75 >; // #declare N = N + 1; } #end #macro grau3(i, j) union{ cylinder{ < i, j, 0 >, < i, j, 0.5>, 0.2 texture{ tx_grau3 } } sphere{ < i, j, 0.75 >, 0.25 texture{ tx_grau3 } } cylinder{ < i, j, 0.25 >, < i + 0.35, j, 0.25 >, 0.1 texture{ tx_tubo } } cylinder{ < i, j, 0.25 >, < i, j + 0.35, 0.25 >, 0.1 texture{ tx_tubo } } cylinder{ < i, j, 0.25 >, < i, j - 0.35, 0.25 >, 0.1 texture{ tx_tubo } } // #declare A[N] = < i - 0.5 + 0.35, j - 0.5, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5, j - 0.5 + 0.35, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5 - 0.35, j - 0.5, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5, j - 0.5 - 0.35, 0.75 >; // #declare N = N + 1; } // tq #end #macro grau4(i, j) union{ sphere{ < i, j, 0.25 >, 0.25 texture{ tx_grau4 } } cone{ < i, j, 0.75 >, 0, < i, j, 0.5 >, 0.3 texture{ tx_grau4 } } cylinder{ < i, j, 0.25 >, < i + 0.35, j, 0.25 >, 0.1 texture{ tx_tubo } } cylinder{ < i, j, 0.25 >, < i, j + 0.35, 0.25 >, 0.1 texture{ tx_tubo } } cylinder{ < i, j, 0.25 >, < i, j - 0.35, 0.25 >, 0.1 texture{ tx_tubo } } cylinder{ < i, j, 0.25 >, < i - 0.35, j, 0.25 >, 0.1 texture{ tx_tubo } } // #declare A[N] = < i - 0.5 + 0.35, j - 0.5, 0.25 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5, j - 0.5 + 0.35, 0.75 >; // #declare N = N + 1; // #declare A[N] = < i - 0.5 - 0.35, j - 0.5, 1.25 >; // #declare N = N + 1; } // tq #end #macro interpola_1(tt, t0, t1, p0, p1) #local ss = (tt - t0)/(t1 - t0); #local vv = (1 - ss)*p0 + ss*p1; vv #end #macro interpola_3(tt, t0, t1, p0, p1, p2, p3) #local p01 = interpola_1(tt, t0, t1, p0, p1); #local p12 = interpola_1(tt, t0, t1, p1, p2); #local p23 = interpola_1(tt, t0, t1, p2, p3); #local p012 = interpola_1(tt, t0, t1, p01, p12); #local p123 = interpola_1(tt, t0, t1, p12, p23); #local p = interpola_1(tt, t0, t1, p012, p123); p #end #include "bezpoly.inc" #macro testa_interpola_3(p0, p1, p2, p3, n, raio) union{ // object{ bezpoly(p0,p1,p2,p3, 1.2*raio) } #local i = 0; #while(i < n) #local centro = interpola_3(i, 0, n, p0, p1, p2, p3); ponto(centro, raio) #local i = i + 1; #end } #end #macro testa_interpola_1(p0, p1, n, raio) union{ #local i = 0; #while(i < n) #local centro = interpola_1(i, 0, n, p0, p1); ponto(centro, raio) #local i = i + 1; #end } #end #include "eixos.inc" union{ // object{ eixos(10) } object { grau3(0,0) translate <0, -4, 1> } object { grau4(0,0) translate <1, 4, 0> } testa_interpola_3( <0,-4,1.25>, <0,8,2.5>, <-2,-8,0.5>, <1, 4, 0.25>, 500, 0.05) box{ <-10, -10, -1>, <+10, +10,-0.1> texture{ tx_chao} } } #declare cmin = < -2.5, -8.5, -1 >; #declare cmax = < +2.0, +8.5, +2 >; #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmin - cmax); #declare dir_camera = < 8.00, 5.00, 7.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.2; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)