// 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.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 } // ====================================================================== // DESCRI��O DA CENA #declare s = seed(1); #declare A = array[1000]; #declare total = 0; #macro torre1(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 } 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 torre2(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 } 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 torre3(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 tubulacao(x1,y1,x2,y2) object { #local altura = 5.0*rand(s); union { cylinder {, , 0.01 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > }} cylinder {, , 0.01 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > }} cylinder {, , 0.01 texture {tx_plastico} pigment { color rgb < 1.00, 1.00, 1.00 > }} } } #end #macro grid(m,n) #for(i, 0, m) #for(j, 0, n) #local r = 3.0*rand(s); #if (r<1) object{torre1(i,j)} #else #if (r<2) object{torre2(i,j)} #else object{torre3(i,j)} #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 /* #macro cria ( m,n ) #declare i = 1; #while (i <= m) object {tabuleiro translate <0,0,-i/10> scale } #declare j = 1; #while (j <= n) #if (mod(i,2) = 0 & mod(j,2) = 0) object{dama translate } #end #if (mod(i,2) = 1 & mod(j,2) = 1) object{peao translate } #end #declare j = j+1; #end #declare i = i+1; #end #end */ #include "eixos.inc" grid(3,3) //cria(4,4) //object {peao} // Aqui est� a cena, finalmente: /* pe union{ object{ eixos(3.00) } union { object{ bolinhaPerna1 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > }} difference { object{perna1 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} object{canto1 texture {tx_plastico}} } } union { object{ bolinhaPerna2 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > }} object{perna2 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} } union { object{ bolinhaPerna3 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > } } difference { object{perna3 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} object{canto3 texture {tx_plastico}} } } union { object{ bolinhaPerna4 texture{ tx_xadrez } pigment{ color rgb < 1.00, 1.00, 0.00 > } } object{perna4 texture {tx_plastico} pigment{ color rgb < 0.80, 0.70, 0.50 > }} } object {assento texture {tx_fosca } pigment{ color rgb < 0.20, 0.20, 0.20 > }} difference { object {encosto texture {tx_vidro}} object {buraco texture {tx_plastico}} } object{ bolota translate < -2,+1,+3 > texture{ tx_espelho } } object{ bolinha translate < +5,+4,+2 > texture{ tx_vidro } interior { ior 1.01 } }*/ #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 2*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)