// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-09-25 18:58:45 by stolfilocal // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_vidro = texture{ pigment{ color rgb < 1, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_plastico = texture{ pigment{ color rgb < 0.50, 0.90, 0.50 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 0.40, 0.01, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRI��O DA CENA #declare raio = 2.500; // Partes da cena: #declare bola = sphere{ < 0.00, 0.00, 0.00 >, raio texture{ tx_plastico } } #declare caixa = box{ <-1,-2,0>, <+1,2,1> texture{ tx_plastico }} #declare assento = box{ <-2,-4,0>, <+8,+4,1> } #declare encosto = box{ <-2,-4,0>, <+0,+4,5> } #declare perna = cylinder{ < 0.00, +0.00, 0.00 >, < 0.00, 0.00, +5.00 >, 0.5 texture{ tx_plastico } } #declare perna_grande = cylinder{ < 0.00, +0.00, 0.00 >, < 0.00, 0.00, +5.00 >, 0.7 texture{ tx_plastico } } #declare bolinha = sphere{ < 0, 0, 0 >, 1 texture{ tx_plastico } } #declare enfeite = cone{ < 0, 0, 0 >, 1 < 0, 0, 3.00 >, 0.5 texture{ tx_plastico } } #declare tanque_cone = cone{ < 0, 0, 0 >, 1 < 0, 0, 3.00 >, 0.5 texture{ tx_plastico } } #declare cano = cylinder{ < 0.00, +0.00, -2.00 >, < 0.00, 0.00, +2.00 >, 0.3 texture{ tx_fosca } } #declare cano_h = cylinder{ < 0.00, +0.00, 0.00 >, < 0.00, 2.00, +.00 >, 0.3 texture{ tx_fosca } } #declare peao = union { object { enfeite } object { bolinha translate < 0,0,4> } object { caixa translate < 0,0,5>} } #declare tanque_a = union { object { perna } object { bolinha translate < 0,0,5>} object { cano translate < 0,0,6>} object { cano_h translate < 0,0,3> } object { cano_h translate < 0,-2,3> } } #declare tanque_b = union { object { tanque_cone } object { caixa translate < 0,0,3>} object { cano translate < 0,0,6>} object { cano_h translate < 0,1,3.5> } object { cano_h translate < 0,-3,3.5> } } #declare tanque_c = union { object { bolinha } object { perna } object { bolinha translate < 0,0,5>} object { cano translate < 0,0,6>} object { cano_h translate < 0,1,5> } object { cano_h translate < 0,-3,5> } } #macro tabuleiro_dentro(r) cylinder{ < 0.00, +0.00, -2.00 >, < 0.00, 0.00, 1.00 >, r texture{ tx_plastico } } #end #macro tabuleiro_fora(r) cylinder{ < 0.00, +0.00, -1.00 >, < 0.00, 0.00, 0.00 >, r texture{ tx_fosca } } #end #macro faixa(r) difference { object { tabuleiro_fora(r) } object { tabuleiro_dentro(r - 3) } } #end #macro tanque1(xx, yy) union { object { tanque_a translate} } #end #macro tanque2(xx, yy) union { object { tanque_b translate} } #end #macro tanque3(xx, yy) union { object { tanque_c translate} } #end #macro tubo(p, q) union { cylinder{ < p.x, p.y, 8.00 >, < q.x, q.y, 8.00 >, 0.3 texture{ tx_fosca } } } #end #declare NMAX = 1000; #declare A = array[NMAX]; #declare N = 0; #declare roleta1 = seed(1234); #declare esp = 7; #declare cont = 0; #macro gera_tanques(m, n) union { #for(i, 0, m - 1) #for(j, 0, n - 1) #declare A[cont] = ; #declare cont = cont + 1; #declare tanq_n = floor(3*rand(roleta1)); #if (tanq_n = 0) object { tanque1(i * esp, j * esp) } #end #if (tanq_n = 1) object { tanque2(i * esp, j * esp) } #end #if (tanq_n = 2) object { tanque3(i * esp, j * esp) } #end #end #end } #end #macro gera_tubulacoes() union { #for(j, 0, cont - 2) #declare atual = A[j]; #declare novo_idx = int(cont*rand(roleta1)); #declare novo = A[novo_idx]; #declare A[j] = novo; #declare A[novo_idx] = atual; #end #for(i, 0, cont - 2) object { tubo(A[i], A[i + 1]) } #end } #end #include "eixos.inc" #declare nfilas = 11; #declare ncols = 7; union{ // object{ eixos(5.00) } object { gera_tanques(nfilas, ncols) } object { gera_tubulacoes() } } #declare tam_cena = < esp*nfilas, esp*ncols, 9 >; #include "camlight.inc" #declare centro_cena = 0.5*tam_cena; #declare raio_cena = 0.60*vlength(tam_cena); #declare dir_camera = < 7.00, 7.00, 5.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)