// 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.90, 0.80, 0.85 > } #declare tx_fosca_cinza = texture{ pigment{ color rgb < 0.3, 0.3, 0.3 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // FORMAS #declare raio = 2.000; // A principio pode-se usar declare ou local #declare tanque = cylinder { < 0, 0, 0>, <0, 0, 3>, 1 // center of one end, center of other end, radius } #declare coneTanque1 = cone { <0, 0, 3>, 1 // , center & radius of one end <0, 0, 4.5>, 0 // , center & radius of the other end } #declare cilindroCortaTanque1 = cylinder { < 0, -2, 2.5>, <0, 2, 2.5>, 0.25 // center of one end, center of other end, radius } #declare bolaTanque2 = sphere{ < 0, 0, 3 >, 1.2 texture{ tx_fosca_cinza } } #declare cilindroCortaTanque2 = cylinder { < 0, 0, 3>, <0, 2, 4>, 0.25 // center of one end, center of other end, radius } #declare quadradoTanque3 = box { <-0.5, -0.5, 3>, <0.5, 0.5, 4> // near lower left corner, far upper right corner } #declare cilindroCortaTanque3 = cylinder { < 0, -2, 3.5>, <0, 2, 3.5>, 0.25 // center of one end, center of other end, radius } // ====================================================================== // Objetos #declare tanque1 = union { object{tanque texture{tx_fosca_cinza}} object{coneTanque1 texture{tx_fosca_cinza}} object{ cilindroCortaTanque1 texture{ tx_fosca_cinza } } object{ cilindroCortaTanque1 rotate <0, 0, 90> texture{tx_fosca_cinza}} } #declare tanque2 = union { object{tanque texture{tx_fosca_cinza}} object{bolaTanque2 texture{tx_fosca_cinza}} object{ cilindroCortaTanque2 texture{ tx_fosca_cinza } } object{ cilindroCortaTanque2 rotate <0, 0, 90> texture{tx_fosca_cinza}} object{ cilindroCortaTanque2 rotate <0, 0, 180> texture{tx_fosca_cinza}} object{ cilindroCortaTanque2 rotate <0, 0, 270> texture{tx_fosca_cinza}} } #declare tanque3 = union { object{tanque texture{tx_fosca_cinza}} object{quadradoTanque3 texture{tx_fosca_cinza}} object{ cilindroCortaTanque3 texture{ tx_fosca_cinza } } object{ cilindroCortaTanque3 rotate <0, 0, 90> texture{tx_fosca_cinza}} } // ====================================================================== // Lógica // #declare NMAX = 300; // #declare array[NMAX] #declare random_tipos = seed(21159); #declare random_m = seed(25613); #declare random_n = seed(15246); #macro gerar_tanque1(xx, yy, i) // union { // #local tq = object{tanque1 translate }; // // position_tank1[i] = tq; // } union { tanque1 translate } #end #macro gerar_tanque2(xx, yy, i) // union { // #local tq = object{tanque2 translate }; // // position_tank2[i] = tq; // } union { tanque2 translate } #end #macro gerar_tanque3(xx, yy, i) // union { // #local tq = object{tanque3 translate }; // // position_tank3[i] = tq; // } union { tanque3 translate } #end #macro gera_tanques(m, n) // union { #local i = 0; #local j = 0; #local Pxx = 0; #local Pyy = 0; // Posição em Z (Pzz) será sempre zero visto que queremos que ele fique no chão #local tipo = int(3*rand(random_tipos)); #while(i; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; // #declare dir_camera = < -2.00, 7.00, 4.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)