// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS #include "textures.inc" background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 1.00, 1.00, 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 < 1, 1.0, 1.00 > filter 0.70 } finish{ diffuse 0.3 reflection 0.01 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 } #declare tx_vermelho = texture{ pigment{ color rgb < 0.80, 0, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_verde = texture{ pigment{ color rgb < 0.00, 0.80, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_azul = texture{ pigment{ color rgb < 0.00, 0.00, 0.80 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare Random_1 = seed (1153); #declare Wall = box {<-1,-4,-4>,<0,4,4>} #declare NeedleMetter = union{ cylinder{ <0,0,0>, <0.05,0,0>, 0.3 texture{tx_fosca}} box { <0.05,-0.05,-0.15>,<0.12,0.05,0.15> texture{Bright_Bronze} } } //#declare RoundButton = // Aqui está a cena, finalmente: #macro CreateSwitch(line, column) union{ #declare rotation = <0,0,0>; #if(rand( Random_1 ) <0.5) #declare rotation = <90,0,0>; #end #declare position = <0,0.4+0.8*column,7.6-0.8*line>; #declare textureSelected = tx_azul; #if(rand( Random_1 ) <0.5) #declare textureSelected = tx_verde; #end box {<0.00, -0.15, -0.3>, <0.05,0.15,0.3> translate position texture{textureSelected}} box { <0.05,-0.05,-0.15>, <0.1,0.05,0.15> translate position texture{textureSelected} translate <0,0,-0.1+0.2*rand( Random_1 )>} } #end #macro CreateNeedleMeter(line, column) union{ #declare position = <0, 0.4 + 0.8 * column, 7.6 - 0.8 * line>; object {NeedleMetter rotate translate position } } #end #declare HalfBall = intersection { sphere {<0,0,0> 0.2 texture{tx_vermelho}} box {<0,-0.2,-0.2>, <0.2,0.2,0.2>} } #macro CreateButton(line, column) union{ #declare position = <0, 0.4 + 0.8 * column, 7.6 - 0.8 * line>; object{HalfBall translate position} } #end union{ object {Wall texture{tx_plastico} translate <0,4,4>} #declare i = 0; #while(i < 10) #declare j = 0; #while(j < 10) #declare randomNumber = rand( Random_1 ); #if(randomNumber <0.33) CreateNeedleMeter(i,j) #else #if(randomNumber <0.66) CreateSwitch(i,j) #else CreateButton(i,j) #end #end #declare j = j + 1; #end #declare i = i + 1; #end } #include "camlight.inc" #declare centro_cena = < 0.00, 4.00, 4.00 >; #declare raio_cena = 9.0; #declare dir_camera = < 40.00, 7.00, 4.00 >; #declare dist_camera = 8.0; #declare intens_luz = 1.400; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)