// 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 = texture{ pigment{ color rgb < 0.80, 0.80, 1.00 > } 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 < 1.51, 0.50, 0.68 > } 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 #declare raio = 5.000; #declare A = array[1000]; #declare N = 0; // Partes da cena: #declare pino = cylinder{ < 0, 0, 0 >, < 0, 0, +1.00 >, 0.75 texture{ tx_fosca } } #declare MyCone = cone { <0, 0, 0>, 1.0 // , center & radius of one end <0, 0, 1>, 0.25 // , center & radius of the other end } #declare MyCylinder = cylinder { <0, 0, -1>, <0, 0, 1>, 1 // center of one end, center of other end, radius open // remove end caps } #declare tubos = cylinder { <0, 0, -1>, <0, 0, 3>, 0.10 // center of one end, center of other end, radius open // remove end caps } #declare MySphere = sphere { <0, 0, 0>, 1.5 // , radius } #declare MyBox = box { <0, 0, 0>, <3, 3, 3> // near lower left corner, far upper right corner } #declare roleta1 = seed(10); #macro tabuleiro(rows, columns) union{ #local i = 0; #while(i,0.2 rotate <0,0,360/columns*j>} #local j = j+1; #end #local i = i+1; #end } #end #macro tanque1 (posx,posy) union { object{MyCylinder translate} object{MyCone translate} object{tubos translate} object{tubos translate rotate <30, 30, 30>} // object{tubos translate rotate <-60, 0, 0>} // } #end #macro tanque2 (posx,posy) union { object{MySphere translate } // object{MySphere translate } // object{tubos translate} object{tubos translate rotate <30, 30, 30>} // object{tubos translate rotate <-60, 0, 0>} // object{tubos translate} object{tubos translate rotate <30, 30, 30>} // } #end #macro tanque3 (posx,posy) union { object{MyBox translate } // } object{MyCone translate } // object{tubos translate} object{tubos translate rotate <30, 30, 30>} // object{tubos translate rotate <-60, 0, 0>} // } #end #macro define_tanque(posx, posy) #local k = int(3*rand(roleta1)); #if(k = 1) object{tanque1(posx, posy)} #end #if(k = 2) object{tanque2(posx, posy)} #end #if(k = 3) object{tanque3(posx, posy)} #end #end #macro gera_tanques(m,n) union{ #local i = 0; #local posicaox = 0; #local posicaoy = 0; #while(i; #declare raio_cena = 10.0; #declare dir_camera = < 14.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)