// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-02 23:16:05 by stolfilocal // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #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 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 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_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #include "eixos.inc" // Definicoes dos solidos gerais #declare tanque_corpo = cylinder { <0,0,0>, <0,0,2>, 0.5 } #declare tanque_tubulacao_centro = cylinder { <2,0,1>, <-2,0,1>, 0.2 } // Definicao dos solidos vertice k = 2 #declare tanque_base_cone = cone{ <0,0,0> , 0.5, <0,0, -1>, 0.2 } #declare tanque_tubulacao_topo_cone = cylinder { <0,0,2>, <0,0,3>, 0.2 } #declare tanque_cone = union { object{ tanque_corpo texture {tx_xadrez}} object{ tanque_base_cone texture {tx_plastico}} object{ tanque_tubulacao_topo_cone texture {tx_fosca}} object{ tanque_tubulacao_centro texture {tx_fosca}} } // Definicao do solidos vertice k = 3 #declare tanque_topo_caixa = box {<1,1,2>, <-1,-1,3>} #declare tanque_tubulacao_topo_caixa = cylinder { <0,0,3>, <0,0,4>, 0.2 } #declare tanque_caixa = union { object{ tanque_corpo texture {tx_xadrez}} object{ tanque_topo_caixa texture {tx_plastico}} object{ tanque_tubulacao_topo_caixa texture {tx_fosca}} object { tanque_tubulacao_centro texture {tx_fosca}} } // Definicao dos solidos vertice k = 4 #declare tanque_topo_esfera = sphere{ <0,0,3>, 1 } #declare tanque_tubulacao_topo_esfera = cylinder { <0,0,4>, <0,0,5>, 0.2 } #declare tanque_esfera = union { object{ tanque_corpo texture {tx_xadrez}} object{ tanque_topo_esfera texture {tx_plastico}} object{ tanque_tubulacao_topo_esfera texture {tx_fosca}} object{ tanque_tubulacao_centro texture {tx_fosca}} } // Definicao de variaveis #declare roleta = seed(20); // Gera tanques #macro gera_tanques(m,n) #declare iteration_m = 0; #while (iteration_m < m) #declare iteration_n = 0; #while (iteration_n < n) #declare numero = rand(roleta); #if (numero <= 0.66 & numero >= 0.33) #debug "Gerou tanque 1\n" object {tanque_cone translate } #end #if (numero > 0.66) #debug "Gerou tanque 2\n" object {tanque_caixa translate } #end #if (numero < 0.33) #debug "Gerou tanque 3\n" object {tanque_esfera translate } #end #declare iteration_n = iteration_n + 1; #end #declare iteration_m = iteration_m + 1; #end #end #declare nrows = 7; #declare ncols = 5; gera_tanques(nrows, ncols) #declare cmin = < 6*(0-0.5), 6*(0-0.5), -1 >; #declare cmax = < 6*(nrows-0.5), 6*(ncols-0.5), -1 >; box{ texture{ pigment{ color rgb 0.9*<1,1,1> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmin - cmax); #declare dir_camera = < 14.00, 7.00, 7.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)