// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_azul = texture{ pigment{ color rgb < 0, 0, 1 > } } #declare tx_vermelho = texture{ pigment{ color rgb < 1,0,0 > } } #declare tx_verde = texture{ pigment{ color rgb < 0,1,0 > } } #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.80, 0.10 > } 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 raio = 2.000; #declare botoes_width = 15; #declare botoes_height = 9; #declare esquemas_tamanho = 20; // Partes da cena: #declare painel_inclinado = difference { box{ < 0,0,0 > < 10,30,7 > } box{ < 0,-1,0 > < 10,31,7 > rotate < 0,-45,0 > translate < 0,0,0 > } } #macro botao_quadrado(m,n) box{ < 0,0,0 > < 0.5,((botoes_width/m)*0.8),((botoes_height/n)*0.8) > } #end #macro esquema_topo(k) box{ < 0,0,0 > < 1,((esquemas_tamanho/k)*0.8),1> } #end #macro painel_final(m,n,k) #declare botao = botao_quadrado(m,n) #declare esquema = esquema_topo(k) #declare botoes = union { #declare j = 0; #declare pos_y = 0; #declare troca_cor = 0; #while (j < n ) #declare i = 0; #declare pos_x = 0; #while (i < m ) #if(mod(troca_cor,7)=0) object{ botao translate < 0,pos_x,pos_y > texture { tx_azul } } #else object{ botao translate < 0,pos_x,pos_y > texture { tx_vermelho } } #end #declare troca_cor = troca_cor + 1; #declare i = i + 1; #declare pos_x = pos_x + (botoes_width/m); #end #declare j = j + 1; #declare pos_y = pos_y + (botoes_height/n); #end } #declare esqueminhas = union { #declare i = 0; #while (i < k) object{ esquema translate < 7,i*esquemas_tamanho/k,15 > texture { tx_vermelho} } #declare i = i + 1; #end } #declare tela = box { < 0,0,0 >, < 0.5, 28-botoes_width, 6 > } #declare painel = union { object{ painel_inclinado texture { tx_verde } } object{ botoes rotate < 0,45,0 > translate < 0,0,0.3 > } object{ tela rotate < 0,45,0 > translate < 0,botoes_width+1,0.3 > texture { tx_azul } } } #end #declare chao = box{ <-50,-50,-1>, <+50,+50,0> } // Instancia o painel painel_final(10,10,5) #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ chao texture{ tx_xadrez } } object{ painel rotate < 0,0,180 > } } #include "camlight.inc" #declare centro_cena = < -5.00, 0.00, 11.00 >; #declare raio_cena = 30.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 160.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)