// 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.8, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0,1,1> } 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 < 0, 0, 1 > } 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 2.0 } // ====================================================================== // DESCRI��O DA CENA #include "eixos.inc" object{ eixos(3.00)} #declare A = array[1000]; #declare k = 0; #macro tan1(i, j) #declare tanque1= union{ cylinder{ <0, 0,0>, <0, 0, 1>, 1 texture{tx_plastico} } cone{ <0,0,1>, 1 <0, 0, 2> 2 texture{tx_plastico} } cylinder{ <0, 0,2>, <0, 0, 3>, 2 texture{tx_plastico} } cone{ <0,0,3>, 2 <0, 0, 4> 1 texture{tx_plastico} } cylinder{ <0, 0,4>, <0, 0, 5>, 1 texture{tx_plastico} } cylinder{ <0, 0,1.5>, <1, 2, 4>, 0.2 texture{tx_xadrez} } cylinder{ <0, 0,5>, <0, 0, 5.5>, 0.2 texture{tx_xadrez} } cylinder{ <0, 0,2.5>, <3, 0, 2.5>, 0.2 texture{tx_xadrez} } } union{object{tanque1 translate scale<0.5, 0.5, 0.5>}} #declare A[k] = <1/2 + i, 2/2 + j, 4/2>; #declare A[k+1] = <0/2 + i, 0/2 + j, 5.5/2>; #declare A[k+2] = <3/2 + i, 0/2 + j, 2.5/2>; #declare k = k+3; #end #macro tan2(i, j) #declare tanque2= union{ box { <-1.2, -1.2, 0>, <1.2, 1.2, 1> texture{tx_plastico} } cylinder{ <0, 0,1>, <0, 0, 2>, 0.7 texture{tx_plastico} } sphere{ <0, 0, 4>, 2 texture{tx_plastico} } cylinder{ <0, 0,6>, <0, 0, 6.5>, 0.2 texture{tx_xadrez} } cylinder{ <0, 0,4>, <3, 0, 4>, 0.2 texture{tx_xadrez} } cylinder{ <0, 0,4>, <0, 3, 4>, 0.2 texture{tx_xadrez} } } union{object{tanque2 translate scale<0.5, 0.5, 0.5>}} #declare A[k] = <0/2 + i, 0/2 + j, 6.5/2> ; #declare A[k+1] = <3/2 + i, 0/2 + j, 4/2>; #declare A[k+2] = <0/2 + i, 3/2 + j, 4/2>; #declare k = k+3; #end #macro tan3(i, j) #declare tanque2= union{ cylinder{ <0, 0,0>, <0, 0, 1>, 0.7 texture{tx_plastico} } cone{ <0,0,1>, 1 <0, 0, 4> 3 texture{tx_plastico} } cylinder{ <0, 0,4>, <0, 0, 4.5>, 0.2 texture{tx_xadrez} } cylinder{ <-2.5, 0,4>, <-2.5, 0, 4.5>, 0.2 texture{tx_xadrez} } cylinder{ <2.5, 0,4>, <2.5, 0, 4.5>, 0.2 texture{tx_xadrez} } } union{object{tanque2 translate scale<0.5, 0.5, 0.5>}} #declare A[k] = <0/2 + i, 0/2 + j, 4.5/2>; #declare A[k+1] = <-2.5/2 + i, 0/2 + j, 4.5/2>; #declare A[k+2] = <2.5/2 + i, 0/2 + j, 2.5/2> ; #declare k = k+3; #end #macro gera_tanques(m, n) #declare roleta1 = seed(2873); #declare i = 0; #while(i1) #local random1 = int(k*rand(roleta2)); #local random2 = int((k-1)*rand(roleta2)); // if(random2 >=random1) // #local random2 = random2 + 1; // #end union{ cylinder{ A[random1], , 0.1 } cylinder{ A[random2], , 0.1 } } #declare k = k-2; #end #end gera_tanques(2, 2) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 8.0; #declare dir_camera = < 100, 100, 60 >; #declare dist_camera = 6*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)