// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-09-30 19:57:13 by jstolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico_verde = texture{ pigment{ color rgb < 0.10, 1.00, 0.70 > } finish{ diffuse 1.0 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca_amarela = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_vidro_verde = texture{ pigment{ color rgb < 0.00, 1.00, 0.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_fosca_vermelha = texture{ pigment{ color rgb <1.00, 0.20, 0.20> } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.15, 0.20, 0.65 >, color rgb < 0.10, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // MACROS #macro extraterrestre(textura) union{ #if (textura = 0) cylinder{ <0, 0, 0.50>, <0, 0, -0.5>, 4 texture{ tx_fosca_amarela } } sphere{ <0, 0, 0>, 2 texture{ tx_fosca_vermelha }} cone{ <0, 0, 0>, 2, <0, 0, 3>, 0 texture{ tx_plastico_verde } } #else cylinder{ <0, 0, 0.50>, <0, 0, -0.5>, 4 texture{ tx_plastico_verde } } sphere{ <0, 0, 0>, 2 texture{ tx_xadrez }} cone{ <0, 0, 0>, 2, <0, 0, 3>, 0 texture{ tx_fosca_vermelha } } #end } #end #macro terraquio(tamanho) union{ #if (tamanho = 1) #local altura = 5; #local raio = 3; #local aresta = 2; #else #local altura = 3; #local raio = 2; #local aresta = 1; #end cylinder{ <0, 0, 0>, <0, 0, altura>, raio texture{ tx_fosca_amarela } } sphere{ <0, 0, altura>, 1.1 * raio texture{ tx_fosca_vermelha }} box{ <-aresta, -aresta, altura + raio>, texture{ tx_plastico_verde } } } #end #macro malha(maximo_x, passo_x, maximo_y, passo_y, objeto, compara_com_seno) union{ #local contadora_y = 0; #while (contadora_y < maximo_y) #local contadora_x = 0; #while (contadora_x < maximo_x) #if (sin(15*contadora_x*contadora_y)>compara_com_seno) #local escolha = (mod(contadora_x+contadora_y, 2)); #if (objeto = 1) object{ extraterrestre(escolha) translate } #else object{ terraquio(escolha) translate } #end #end #local contadora_x = contadora_x + 1; #end #local contadora_y = contadora_y + 1; #end } #end // Aqui est� a cena, finalmente: union{ #local linhas_x = 10; #local passo_x = 10; #local linhas_y = 10; #local passo_y = 10; //object{extraterrestre(1) translate <5, 5, 0>} //object{terraquio(0) translate <-5, -5, 0>} object{ malha(linhas_x, passo_x, linhas_y, passo_y, 1, -0.4) translate <+10, 0, 0>} object{ malha(linhas_x, passo_x, linhas_y, passo_y, 0, 0) translate <-linhas_x * passo_x, 0, 0>} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 150.0; #declare dir_camera = < 14.00, 7.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)