// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-17 12:13:53 by stolfilocal // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.90, 0.80, 0.85 > } #declare tx_fosca_cinza = texture{ pigment{ color rgb 2*< 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 bolaVertice1 = sphere{ < 0, 0, 0 >, 1.2 texture{ tx_fosca_cinza } } #declare cilindroVertice1 = cylinder { < 0, 0, 0>, <0, 1, 2>, 0.25 // center of one end, center of other end, radius } #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 } } } #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, 120> texture{tx_fosca_cinza}} object{ cilindroCortaTanque2 rotate <0, 0, 240> 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}} } #declare bola1 = union{ object{bolaVertice1} object{cilindroVertice1} } // ====================================================================== // Lógica #macro interpola1(t_, t0, v0, t1, v1) #local ss = (t_-t0)/(t1-t0); #local vv = (1-ss)*v0+ss*v1; vv #end #macro interpola3(t_, ta, tb, v0, v1, v2, v3) #local v01 = interpola1(t_, ta, v0, tb, v1); #local v12 = interpola1(t_, ta, v1, tb, v2); #local v23 = interpola1(t_, ta, v2, tb, v3); #local v012 = interpola1(t_, ta, v01, tb, v12); #local v123 = interpola1(t_, ta, v12, tb, v23); #local v0123 = interpola1(t_, ta, v012, tb, v123); v0123 #end #macro testa_interpola_1(p0, p1, n, raio) union{ #local i = 0; #while(i < n) #local j=0; #local centro = interpola1(i,j,p0,n,p1); object{ sphere { centro, raio texture{tx_fosca_cinza} }} #local i = i + 1; #end } #end #declare tx_bug = texture{ pigment{ color rgb < 1.000, 0.200, 0.000 > } finish{ diffuse 0.5 ambient 0.5 } } #include "bezpoly.inc" #macro testa_interpola_3(p0, p1, p2, p3, n, raio) union{ object{ bezpoly(p0,p1, p2, p3, 0.8*raio) texture {tx_bug } } #local i = 0; #while(i < n) #local j=0; #local centro = interpola3(i,j,n, p0,p1,p2,p3); object{ sphere { centro, raio texture{tx_fosca_cinza} }} #local i = i + 1; #end } #end #include "eixos.inc" union { // object{ eixos(15) } object{tanque1 translate < -3, -5, +5> } object{tanque2 translate < -3, +5, -5> } object{tanque3 translate < +6, +3, -5> } #local p0 = < -3, -3, 7.5>; #local p1 = < -3, +6, 8.00 >; #local p2 = < +6, -6, 0.00 >; #local p3 = < +6, +1, -1.5>; #local n = 200; #local raio = 0.25; object{testa_interpola_3(p0, p1, p2, p3, n, raio)} } #declare cmin = < -7,-8,-6 >; #declare cmax = < +10,+8,+10 >; box{ cmin, texture{ pigment{ color rgb <0.80,0.70,0.60> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmin - cmax); #declare dir_camera = < 14.00, 7.00, 4.00 >; // < 0,1,0>; // #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)