// 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_madeira = texture{ pigment{ color rgb < 139/255, 69/255, 19/255 > } finish{ diffuse 0.8 ambient 0.5 specular 0.5 roughness 0.005 } } #declare tx_bit = texture{ pigment{ color rgb < 255/255, 255/255, 255/255 > } finish{ diffuse 0.8 ambient 0.5 specular 0.5 roughness 0.005 } } #declare tx_haste = texture{ pigment{ color rgb < 0.3, 0.3, 0.3 > } finish{ diffuse 0.8 ambient 0.5 specular 0.5 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.12, 0.10 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #include "math.inc" // ====================================================================== // DESCRIÇÃO DA CENA #macro bit(valor,defeito) union{ #if (defeito=0) torus { 0.5, 0.25 #if (valor!=0) translate <0,1+valor,0> #else translate<0,1,0> #end texture{tx_bit} } #else sphere{<0,0,0>,0} #end cylinder{<0,0,0>,<0,2.5,0>,0.25 texture{tx_haste} } } #end #macro fileira(n,valor,prob) #local i=0; #local Value=int(valor); #local frac = valor - Value; union{ #while(i } #local Value = int(Value/2); #local i = i+1; #end box { <0,1,0>, <1,4.5,3> texture{tx_madeira} } box { , texture{tx_madeira} } box { <1,3.5,0>, texture{tx_madeira} } } #end #macro abaco(m,n,valores,prob) #local fila=0; union{ box{<0,0,0>, <2*n+3.5,1,3> texture{tx_madeira} } #while(fila } #local fila = fila+1; #end } #end #declare roleta=seed(532); #declare valores = array[10] {(1-clock)*0+clock*10,(1-clock)*10+clock*20,(1-clock)*20+clock*30,(1-clock)*30+clock*40,(1-clock)*40+clock*50,(1-clock)*50+clock*60,(1-clock)*60+clock*70,(1-clock)*70+clock*80,(1-clock)*80+clock*90,(1-clock)*90+clock*100} #declare valores2 = array[10] {1,1.2,1.4,1.6,1.8,2,2.4,2.6,2.8,3} #declare raio = 10.000; #include "eixos.inc" // Aqui está a cena, finalmente: union{ object {eixos(15.00) } object {abaco(5,5,valores,0.1) // translate<10,0,0> } // object {abaco(5,7,valores2,0.05) // translate<-10,0,0> // } // box{ <-20,-20,-1>, <+50,+50,0> translate < 0,0,-5 > texture{ tx_xadrez } } } #if(clock>0.5) #declare Variation=3-4*clock; #else #declare Variation=4*clock-1; #end #include "camlight.inc" #declare centro_cena = < 3.00, 8.00, 0.00 >; #declare raio_cena = 25-4*Variation; #declare dir_camera = < Variation, 2.00,50.00 >; #declare dist_camera = 35; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)