// 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_pele = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_azul = texture{ pigment{ color rgb < 0, 0.25, 0.70 > } } #declare tx_verde = texture{ pigment{ color rgb < 0, 0.7, 0.25 > } } #declare tx_cinza = texture{ pigment{ color rgb < 0.95, 0.95, 0.95 > } } #declare tx_laranja = texture{ pigment{ color rgb < 0.6, 0.4, 0.1 > } } #declare tx_marrom = texture{ pigment{ color rgb < 0.70, 0.3, 0.0 >} } #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 0.1 } #declare tx_xadrez2 = texture{ pigment{ checker color rgb < 0.70, 0.82, 0.0 >, color rgb < 0.10, 0.4, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.1 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #declare campo = box { <3, 1, 0>, <-3, -1, -0.25> texture { tx_azul } } #declare bloco_concreto = box { <0, 0, 0>, <0.2, 0.2, 0.2> texture { tx_cinza } } #declare bloco_escada = box { <0, 0, 0>, <0.1, 0.1, 0.1> texture { tx_marrom } } #declare banco= union { box { <0, 0, 0>, <0.18, 0.18, 0.02> texture { tx_laranja } } box { <0.0, 0.14, 0>, <0.18, 0.18, 0.18> texture { tx_laranja } } } #declare cabeca = sphere { <0.1, 0.1,0.3>, 0.06 texture{ tx_pele } } #declare corpo = cylinder { <0.1,0.1,0.1>, <0.1,0.1,0.3>, 0.05 } #declare saia = cone { <0.1,0.1,0>, 0.1 <0.1,0.1,0.2>,0 } #declare pessoa = union{ object{ cabeca } object{ corpo } object{ saia } } // Macros: #macro escada(degraus, largura) union { #declare i = 0; #while(i < degraus) #declare j = 0; #while(j<2) object{ bloco_escada scale<2* largura, 1,1> translate<0, i*0.1, i*0.1>} #declare j = j + 1; #end #declare i = i + 1; #end } #end #macro torcedor(i, j, tx) object{ pessoa translate texture { tx }} #end #macro secao(degraus, largura, torc, tt) #local tt2 = tt*2; #if(tt2<1) #local tt3 = tt2; #else #local tt3 = tt2-1; #end #if(tt3<0.25) #local ntt = tt3; #else #if(tt3<0.5) #local ntt = 0.5 - tt3; #else #if(tt3<0.75) #local ntt = tt3 - 0.5; #else #local ntt = 1 - tt3; #end #end #end #if(tt<0.5) #local trvect = <0.1*ntt, 0, 0>; #else #local trvect = <-0.1*ntt, 0, 0>; #end union { #declare i = 0; #while(i < degraus) object{ bloco_concreto translate<0, i*0.2, 0> scale } #declare j = 0; #while(j < largura) object{ banco translate } #if(mod(i*j+1, torc+1)>torc/3) object {torcedor(i, j, #if(mod(i*j+i+j, torc+1)>0) tx_xadrez #else tx_xadrez2 #end ) //#if((torc=1) & (i=0) & (j=0)) translate trvect //#end } #end #declare j = j + 1; #end #declare i = i + 1; #end } #end #include "eixos.inc" // Aqui está a cena, finalmente: #declare roleta = seed(350); #macro setor(tt, torc) union{ object { escada(10, 4) } object { secao(3, 8, torc, tt) translate<0.8,0,0> } object { secao(2, 10, torc, tt) translate<0.8,0.6,0.6> } object { escada(6, 2) translate<2.4,0,0> } } #end union{ object{ eixos(3.00) } object { setor(clock, 1) } object { setor(clock, 2) rotate 90*z translate<0, -2.8, 0>} object { setor(clock, 3) scale <1,-1,1> translate<0, -2.8, 0>} object { setor(clock, 4) rotate 90*z translate<0, -2.8, 0> scale <-1,1,1> translate<2.8, 0, 0> } } #include "camlight.inc" #declare centro_cena = < 0.00, 2.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, -20.00, 16.00 >; #declare dist_camera = 20.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)