// 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 } } #include "math.inc" // ====================================================================== // DESCRIÇÃO DA CENA #macro bit(valor,defeito) union{ #if (defeito=0) torus { 0.5, 0.25 #if (valor=1) translate <0,2,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=valor; 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, 2, 3, 4, 5, 6, 7, 8, 9, 10} #declare valores2 = array[10] {11,12,13,14,15,16,17,18,19,20} #declare raio = 10.000; #include "eixos.inc" // Aqui está a cena, finalmente: union{ object {eixos(15.00) } object {abaco(10,10,valores,0.1) translate<10,0,0> } object {abaco(5,7,valores2,0.05) translate<-10,0,0> } } #include "camlight.inc" #declare centro_cena = < 10.00, 15.00, 0.00 >; #declare raio_cena = 30.0; #declare dir_camera = < 0.00, 10.00,50.00 >; #declare dist_camera = 65.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)