// 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 <143, 221, 242>/255} #declare tx_xadrez = texture{ pigment{ checker color rgb < 0, 0, 0 >, color rgb < 1, 1, 1 > } finish{ diffuse 0.9 ambient 0.1 } scale 1 } // ====================================================================== // DESCRI��O DA CENA #declare chao = box{ <0, 0, -1>, <2, 2, 0> } // Partes da cena: #declare cubo = box { <-1, -1, 0>, <1, 1, 2> pigment { color rgb <0.5, 0.5, 0.5>} } #declare bola = sphere { <0, 0, 0>, 1 pigment { color rgb <0.5, 0.5, 0.5>} } #declare corpo = cylinder { <0, 0, 0>, <0, 0, 3>, 0.5 pigment { color rgb <0.5, 0.5, 0.5>} } #declare ponta = cone { <0, 0, 0>, 0.25 <0, 0, 1>, 0.5 pigment { color rgb <0.5, 0.5, 0.5>} } #declare cano = cylinder { <0, 0, 0>, <0, 0, 2>, 0.125 pigment { color rgb <0.075, 0.675, 0.675>} } #macro tanque1 (x0, y0) #local tq1 = union{ object{ cubo translate<0, 0, 0>} object{ bola translate <0, 0, 2> } object{ cano translate <0, 0, 2> } object{ cano rotate <90, 0, 0> translate <0, 0, 1> } object{ cano rotate <0, 90, 0> translate <0, 0, 1> } translate scale 0.5 } tq1 #end #macro tanque2 (x0, y0) #local tq2 = union{ object{ corpo } object{ bola translate<0, 0, 1.5> } object{ cano translate <0, 0, 2> } object{ cano rotate <90, 0, 0> translate <0, 1, 1.5> scale <1, 2, 1> } translate scale 0.5 } tq2 #end #macro tanque3 (x0, y0) #local tq3 = union{ object{ corpo scale<1, 1, 0.35> translate <0, 0, 0.99> } object{ ponta } object{ ponta translate <0, 0, -3> rotate <180, 0, 0> } object{ cano rotate <90, 0, 0> translate <0, 1, 1.5> scale <1, 2, 1> } object{ cano rotate <0, 90, 0> translate <-1, 0, 1.5> scale <2, 1, 1> } translate scale 0.5 } tq3 #end #declare rolTanque = seed(3); #macro gera_tanques (m, n) #declare i = 0; #declare k = 0; union { #while (i < m) #declare j = 0; #while (j < n) #declare c = mod(k, 2); #declare k = k + 1; #local planta = union{ #if (c = 1) object{ chao pigment { color rgb <0, 0, 0>} translate } #else object{ chao pigment { color rgb <1, 1, 1>} translate } #end #declare tipo = rolTanque; #if (tipo < 1) tanque1(i * 2, j * 2) #else if(tipo < 2) tanque2(i * 2, j*2) #else tanque3(i * 2, j * 2) #end } object { planta } #declare j = j + 1; #end #declare i = i + 1; #end } #end #include "eixos.inc" #include "textures.inc" // Aqui est� a cena, finalmente: union { object{ eixos(3.0)} gera_tanques(3, 3) //tanque1(1, 1) //tanque2(-2, -2) //tanque3(4, -2) } #include "camlight.inc" #declare centro_cena = < 5.00, 5.00, 1.00 >; #declare raio_cena = 10.0; #declare dir_camera = < 10.00, -10.00, 5.0 >; #declare dist_camera = 20*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)