// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-17 14:31:12 by stolfilocal // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.5, 0.5, 0.5 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 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.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } 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 } #declare s = seed(6); #declare A = array[1000]; #declare total = 0; #macro torre1(cx,cy) union { object { sphere { <0, 0, 0.33>, 0.33 texture {tx_plastico} pigment { color rgb < 0.00, 1.00, 0.00 > } translate } } cylinder {<0,0.25,0.5>, <0,0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } } #declare A[total] = ; #end #macro torre2(cx,cy) union { object {intersection { cone{ <0,0,0>,0.5 <0,0,1>,0 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 0.00 > }} box{ <-0.25,-0.25,0>, <0.25,0.25,1> texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 0.00 >}} } translate } cylinder {<0,0.25,0.5>, <0,0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } cylinder {<0,-0.25,0.5>, <0,-0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } } #declare A[total] = ; #declare total = total + 1; #declare A[total] = ; #declare total = total + 1; #end #macro torre3(cx,cy) union { cylinder { <0,0,0>, <0,0,0.5>, 0.25 texture {tx_plastico} pigment { color rgb < 1.00, 0.00, 0.00 > } translate } cone{ <0,0,0.5>, 0.25 <0,0,1>, 0 texture {tx_plastico} pigment { color rgb < 1.00, 0.00, 0.00 >} translate } cylinder {<0,0.25,0.5>, <0,0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } cylinder {<0,-0.25,0.5>, <0,-0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } cylinder {<0.25,0,0.5>, <0.3,0,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } } #declare A[total] = ; #declare total = total + 1; #declare A[total] = ; #declare total = total + 1; #declare A[total] = ; #declare total = total + 1; #end #macro torre4(cx,cy) union { box{ <-0.25,-0.25,0>, <0.25,0.25,0.5> texture {tx_plastico} pigment { color rgb < 0.00, 0.00, 1.00 >} translate } cylinder { <0,0,0.5>, <0,0, 1>, 0.25 texture {tx_plastico} pigment { color rgb < 0.00, 0.00, 1.00 > } translate } cylinder {<0,0.25,0.5>, <0,0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } cylinder {<0,-0.25,0.5>, <0,-0.3,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } cylinder {<0.25,0,0.5>, <0.3,0,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } cylinder {<-0.25,0,0.5>, <-0.3,0,0.5> 0.05 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > } translate } } #declare A[total] = ; #declare total = total + 1; #declare A[total] = ; #declare total = total + 1; #declare A[total] = ; #declare total = total + 1; #declare A[total] = ; #declare total = total + 1; #end #macro interpola1(tt,t0,v0,t1,v1) #local ss = (tt-t0)/(t1-t0); #local vv = (1-ss)*v0 + ss*v1; vv #end #macro interpola3(tt,ta,tb,v0,v1,v2,v3) #local v01 = interpola1(tt,ta,v0,tb,v1); #local v12 = interpola1(tt,ta,v1,tb,v2); #local v23 = interpola1(tt,ta,v2,tb,v3); #local v012 = interpola1(tt,ta,v01,tb,v12); #local v123 = interpola1(tt,ta,v12,tb,v23); #local v0123 = interpola1(tt,ta,v012,tb,v123); v0123 #end #macro interpola3_multi(tt, pini, n, ap1, ap2, pfim) //k = 0, k = n-1 #local k = int(tt); #if (k = 0) #local q0 = pini; #else #local q0 = (ap2[k-1] + ap1[k])/2; #end #local q1 = ap1[k]; #local q2 = ap2[k]; #if (k = n-1) #local q3 = pfim; #else #local q3 = (ap2[k] + ap1[k+1])/2; #end #local pt = interpola3(tt, k, k+1, q0, q1, q2,q3); pt #end #macro testa_interpola_1(p0,p1,n,raio) union { #for(i,0,n) #local centro = interpola1(i,0,p0,n,p1); sphere {centro, raio texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > }} #end } #end #macro testa_interpola_3(v0,v3,n,raio) #local a1 = 4.0*rand(s)-2; #local a2 = 4.0*rand(s)-2; #local v1 = <(v0.x+v3.x)/3, (v0.y + v3.y)/3, a1>; #local v2 = <(2*(v0.x+v3.x))/3, (2*(v0.y+v3.y))/3, a2>; union { #for(i,0,n) #local centro = interpola3(i,0,n,v0,v1,v2,v3); sphere {centro, raio texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > }} #end } #end #macro tubulacao(x1,y1,x2,y2) object { testa_interpola_3(, , 50, 0.02) } #end #macro grid(m,n) #for(i, 0, m-1) #for(j, 0, n-1) #local r = 4.0*rand(s); #if (r<1) object{torre1(i,j)} #else #if (r<2) object{torre2(i,j)} #else #if (r<3) object{torre3(i,j)} #else object{torre4(i,j)} #end #end #end #end #end #while (total > 1) #local ponto1 = total*rand(s); #local start = A[ponto1]; #declare A[ponto1] = A[total-1]; #declare total = total-1; #local ponto2 = total*rand(s); #local fini = A[ponto2]; #declare A[ponto2] = A[total-1]; #declare total = total-1; object{tubulacao(start.x,start.y, fini.x, fini.y)} #end #end #include "eixos.inc" //testa_interpola_1(<-2,2,-2>,<2,-2,2>,10,0.05) //grid(3,3) #local pini = <0,0,0>; #local n = 3; #local p1 = array[n]; #local p2 = array[n]; #local p1[0] = <0,1,0>; #local p2[0] = <-1, 2, 2>; #local p1[1] = <2,0,2>; #local p2[1] = <2,2,0>; #local p1[2] = <3, -1, 0>; #local p2[2] = <-3,-1,3>; #local pfim = <+4,+1,+4>; #declare raio = 0.07; #include "bezpoly.inc" union { // object{ eixos(5) } object{ bezpoly_multi(n, pini, p1, p2, pfim, 0.9*raio) } #local i = 0; #while (i < n) #local pt=interpola3_multi(i, pini, n, p1,p2,pfim); sphere {pt, raio texture {tx_plastico} pigment { color rgb < (i/2.0), 1.0 - (i/2.0), 1.00 > }} #local i = i+0.2*raio; #end } #declare cmin = < -5,-2.5,-0.2 >; #declare cmax = < +5,+2.5,+4.0 >; 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.4*vlength(cmin - cmax); declare dir_camera = < 12.00, 9.00, 4.00 >; // < 0.0001,0,1>; // #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)