// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-08-16 20:54:02 by jevs // Original version by jstolfi // Moved Around by jevs // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.45, 0.10, 0.20 > } #declare tx_tanque = 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_cano = texture{ pigment{ color rgb < 1.0, 1.0, 0.0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.15, 0.6 , 0 >, color rgb < 0, 0 , 0 > } finish{ diffuse 0.9 ambient 0.1 } scale 5.0 } // ====================================================================== // DESCRI��O DA CENA #declare raio = 2.000; #declare raioIni = 3; #declare chao = disc { <0, 0, 0>, <0, 0, 1>, 200 texture { tx_xadrez } } // ===================================================================== #macro tqR( px, py ) object{ union { union { box { <-1, -1, -0>, <1, 1, 2> texture { tx_tanque } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } rotate <0, 0, 90> // } } translate // } #end #macro tqT( px, py ) object{ union { union { torus { 0.5, .25 // major radius, minor radius rotate <90, 0, 0> // texture { tx_tanque } translate <0, 0, 0.25> // } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.125 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.125 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } rotate <0, 0, 90> // } } translate // } #end #macro tqC( px, py ) object{ union { union { cylinder { <0, 0, 0>, <0, 0, 2>, 1 // center of one end, center of other end, radius texture { tx_tanque } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } rotate <0, 0, 90> // } } translate // } #end #declare roleta = seed(3453); #macro gera_tanques(m, n) #local i = 0; #while(i < n) #local xOffset = 4; #local yOffset = 4; #local j = 0; #while(j < m) #declare k = mod(int(3*rand(roleta)), 3); #local posX = i*xOffset; #local posY = j*yOffset; #switch(k) #case(0) tqC(posX, posY) #break #case(1) tqT(posX, posY) #break #case(2) tqR(posX, posY) #break #end #local j = j+1; #end #local i = i+1; #end #end // Aqui est� a cena, finalmente: #include "eixos.inc" union{ object{ eixos(3.00)} // object{ tqRet } // object{ tqCil } gera_tanques(10,30) object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 10.0; #declare dir_camera = < -10.00, -10.00, 5.00 >; #declare dist_camera = 13*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)