// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-11 12:48:45 by stolfilocal // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.8, 0.85 > } #declare tx_bug = texture{ pigment{ color rgb < 1.000, 0.800, 0.000 > } finish{ diffuse 0.5 ambient 0.5 } } #declare tx_verde = texture{ pigment{ color rgb < 0,1,1> } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_azul = texture{ pigment{ color rgb < 0,0,1> } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_vermelha = texture{ pigment{ color rgb < 1,0,0> } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_preta = texture{ pigment{ color rgb < 0,0,0> } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // DESCRI��O DA CENA #declare A = array[1000]; #declare k = 0; #macro tan4(i, j) #declare tanque1= union{ cylinder{ <0, 0,0>, <0, 0, 1>, 1 texture{tx_verde} } cone{ <0,0,1>, 1 <0, 0, 2> 2 texture{tx_verde} } cylinder{ <0, 0,2>, <0, 0, 3>, 2 texture{tx_verde} } cone{ <0,0,3>, 2 <0, 0, 4> 1 texture{tx_verde} } cylinder{ <0, 0,4>, <0, 0, 5>, 1 texture{tx_verde} } cylinder{ <0, 0,1.5>, <1, 2, 4>, 0.2 texture{tx_verde} } cylinder{ <0, 0,5>, <0, 0, 5.5>, 0.2 texture{tx_verde} } cylinder{ <0, 0,2.5>, <3, 0, 2.5>, 0.2 texture{tx_verde} } cylinder{ <0, 0,2.5>, <2, -1, 4>, 0.2 texture{tx_verde} } } union{object{tanque1 translate} scale<1/2, 1/2, 1/2>} #declare A[k] = <(1 + i)/2, (2 + j)/2, 4/2>; #declare A[k+1] = <(0 + i)/2, (0 + j)/2, 5.5/2>; #declare A[k+2] = <(3 + i)/2, (0 + j)/2, 2.5/2>; #declare A[k+3] = <(2 + i)/2, (-1 + j)/2, 4/2>; #declare k = k+4; #end #macro tan2(i, j) #declare tanque2= union{ box { <-1.2, -1.2, 0>, <1.2, 1.2, 1> texture{tx_azul} } cylinder{ <0, 0,1>, <0, 0, 2>, 0.7 texture{tx_azul} } sphere{ <0, 0, 4>, 2 texture{tx_azul} } cylinder{ <0, 0,4>, <2, 0, 6>, 0.2 texture{tx_azul} } cylinder{ <0, 0,4>, <-2, 0, 6>, 0.2 texture{tx_azul} } } union{object{tanque2 translate scale<0.5, 0.5, 0.5>}} #declare A[k] = <2/2 + i/2, 0/2 + j/2, 6/2> ; #declare A[k+1] = <-2/2 + i/2, 0/2 + j/2, 6/2>; #declare k = k+2; #end #macro tan3(i, j) #declare tanque2= union{ cylinder{ <0, 0,0>, <0, 0, 1>, 0.7 texture{tx_vermelha} } cone{ <0,0,1>, 1 <0, 0, 4> 3 texture{tx_vermelha} } cylinder{ <0, 0,4>, <0, 0, 5>, 0.2 texture{tx_vermelha} } cylinder{ <-2.5, 0,4>, <-2.5, 0, 5>, 0.2 texture{tx_vermelha} } cylinder{ <2.5, 0,4>, <2.5, 0, 5>, 0.2 texture{tx_vermelha} } } union{object{tanque2 translate scale<0.5, 0.5, 0.5>}} #declare A[k] = ; #declare A[k+1] = <-2.5/2 + i/2, 0/2 + j/2, 5/2>; #declare A[k+2] = <2.5/2 + i/2, 0/2 + j/2, 5/2> ; #declare k = k+3; #end #macro interpola1(k, t0, v0, t1, v1) #local ss = (k-t0)/(t1-t0); #local vv = (1-ss)*v0+ (ss*v1); vv #end #macro interpola3(k, ta, tb, v0, v1, v2, v3) #declare v01 = interpola1(k, ta, v0, tb, v1); #declare v12 = interpola1(k, ta, v1, tb, v2); #declare v23 = interpola1(k, ta, v2, tb, v3); #declare v012 = interpola1(k, ta, v01, tb, v12); #declare v123 = interpola1(k, ta, v12, tb, v23); #declare v0123 = interpola1(k, ta, v012, tb, v123); v0123 #end #macro testa(p0, p1, n, raio) union{ #declare i = 1; #while (i !=n+1) #declare centro = interpola1(i, 0, p0, n+1, p1); object{sphere{centro, raio}} #declare i = i+1; #end } #end #macro testa3(p0, p1, p2, p3, n, raio) union{ #declare i = 1; #while (i !=n+1) #declare centro = interpola3(i, 0,n+1, p0, p1, p2, p3); object{sphere{centro, raio} texture{ tx_bug }} #declare i = i+1; #end } #end tan3(0, 0) tan2(5, 20) tan4(15, 5) testa3(A[2], <9, 7, 9>, <-2, 2, 5>, A[6], 3000, 0.1) testa3(A[5], <-9, 17, 1>, <3, -19, 1>, A[8], 3000, 0.1) #include "eixos.inc" // object{ eixos(15) } #declare cmin = < -2, -6, -0.5 >; #declare cmax = < +8, +12, +4.0 >; box{ cmin-<2,2,0> +<2,2,0.01> texture{ pigment{ color rgb 0.9*<1,1,1> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.5*vlength(cmin - cmax); #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)