// Persistence of Vision Ray Tracer POV-Ray scene file "pavm_test.pov" // POV-Ray 3.7 // author: BGimeno // Random pavement pigment generator testing. //-------------------------------------------------------------------------- // Set this value to change your random seed. #declare MyRand = 31415 ; #declare SHOW_PARAMS = off ; /* +KFI1 +KFF50 +KI0 +KF50 Include these parameters in your command line OR cut and paste next lines in a new PAVMNT.ini file and put this file into the parameters line (EXAMPLE POVRAY +Ipavm_test.pov PAVMNT.INI) *************************** Initial_Frame = 1 ; Final_Frame = 50; // if you increase this value beyond 100 you are sick! Initial_Clock=0; Final_Clock=Final_Frame; *************************** */ //-------------------------------------------------------------------------- #version 3.7; #include "colors.inc" global_settings{ assumed_gamma 1.0 } #default{ finish{ ambient 0.1 diffuse 0.9 }} //-------------------------------------------------------------------------- camera { orthographic location <0,0,-10> look_at <0,0,0> angle 15 right x*image_width/image_height } background {colour <.75,.5,.30> } // ---------------------------------------- #fopen Wrt_Params "output.txt" #if (clock=1) write #else append #end #macro clr_mp (n) #local c1 = rgb ; #switch (n) #case (1) colour_map{ [ 0.00 colour rgb<1.00, 1.00, 1.00> ] [ 0.20 colour rgb<1.00, 1.00, 1.00> ] [ 0.20 colour rgb<0.00, 0.00, 0.00> ] [ 0.60 colour rgb<0.00, 0.00, 0.00> ] [ 0.60 colour rgb c1 ] [ 1.00 colour rgb c1 ] } // end colour_map #break #case (2) colour_map{ [ 0.00 colour rgb<1.00, 1.00, 1.00> ] [ 0.50 colour rgb<1.00, 1.00, 1.00> ] [ 0.51 colour rgb<0.00, 0.00, 0.00> ] [ 1.00 colour rgb<0.00, 0.00, 0.00> ] } // end colour_map #break #case (3) colour_map{ [ 0.00 colour rgb<1.00, 1.00, 1.00> ] [ 0.9 colour rgb<1.00, 1.00, 1.00> ] [ 0.91 colour rgb<0.00, 0.00, 0.00> ] [ 1.00 colour rgb<0.00, 0.00, 0.00> ] } // end colour_map #break #case (4) colour_map{ [ 0.00 colour rgb<0.00, 0.00, 0.00> ] [ 0.9 colour rgb<0.00, 0.00, 0.00> ] [ 0.91 colour rgb<1.00, 1.00, 1.00> ] [ 1.00 colour rgb<1.00, 1.00, 1.00> ] } // end colour_map #break #case (5) colour_map{ [ 0.00 colour rgb c1 ] [ 0.9 colour rgb c1 ] [ 0.91 colour rgb<0.00, 0.00, 0.00> ] [ 1.00 colour rgb<0.00, 0.00, 0.00> ] } // end colour_map #break #case (6) colour_map{ [ 0.00 colour rgb<0.00, 0.00, 0.00> ] [ 0.10 colour rgb<0.00, 0.00, 0.00> ] [ 0.11 colour rgb c1 ] [ 0.5 colour rgb c1 ] [ 0.51 colour rgb<0.00, 0.00, 0.00> ] [ 0.61 colour rgb<0.00, 0.00, 0.00> ] #switch (rand(rnd)) #range (1,1/5) [ 0.62 colour rgb c1*.5 ] [ 0.89 colour rgb c1*.5 ] #break #range (1/5,2/5) [ 0.62 colour rgb ] [ 0.89 colour rgb ] #break #range (2/5,3/5) [ 0.62 colour rgb ] [ 0.89 colour rgb ] #break #range (3/5,4/5) [ 0.62 colour rgb ] [ 0.89 colour rgb ] #break #range (4/5,5/5) [ 0.62 colour rgb ] [ 0.89 colour rgb ] #break #else [ 0.62 colour rgb ] [ 0.89 colour rgb ] #break #end [ .99 colour rgb<0.00, 0.00, 0.00> ] [ 1.00 colour rgb<0.00, 0.00, 0.00> ] } // end colour_map #break #case (7) colour_map{ [ 0 colour rgb ] [ 0.2 colour rgb<0.00, 0.00, 0.00> ] [ 0.3 colour rgb<0.00, 0.00, 0.00> ] [ 1/3 colour rgb *1/3 ] [ 0.5 colour rgb<0.00, 0.00, 0.00> ] [ 0.56 colour rgb<0.00, 0.00, 0.00> ] [ 2/3 colour rgb *2/3 ] } // end colour_map #break #case (8) colour_map{ [ 0 colour rgb c1 ] [ 1/2 colour rgb c1 ] [ 1/2 colour rgb c1*1/3 ] [ 2/3 colour rgb c1*2/3 ] [ 1 colour rgb c1*2/3 ] } // end colour_map #break #case (9) colour_map{ [ 0 colour rgb c1 ] [ 0.9 colour rgb c1 ] [ 1 colour rgb c1*0.618 ] } // end colour_map #break #else colour_map{ [ 0.00 colour rgb<1.00, 1.00, 1.00> ] [ 0.20 colour rgb<1.00, 1.00, 1.00> ] [ 0.20 colour rgb<0.00, 0.00, 0.00> ] [ 0.60 colour rgb<0.00, 0.00, 0.00> ] [ 0.60 colour rgb c1 ] [ 1.00 colour rgb c1 ] } // end colour_map #end // switch #end // macro //------------------------------------------------------------------------------------ #declare rnd = seed (clock*MyRand); // 0 1 2 #declare n_sides_array = array [3]{3,4,6} ; #declare n_tiles_array = array [5]{1,2,3,4,5} ; #declare n_shptr_ex_array = array [3]{0,1,2} ; #declare n_sides_rand = int(3*rand(rnd)) ; #declare n_tiles_rand = int(5*rand(rnd)) ; #declare n_sides = n_sides_array[n_sides_rand] ; // 3 triangle, 4 quadrat, 6 hexagon #declare n_tiles = n_tiles_array[n_tiles_rand] ; // (1 to 5 or 6): the number of basic tiles to combine together to make one real tile // Sides | Tiles: 1 2 3 4 5 6 //------------------------------------------ // 3 | 1 1 1 3 4 12 // 4 | 1 1 2 5 12 35 // 6 | 1 1 3 7 22 #declare pat_array = array [3][6] { {1,1,1,3,4,12} {1,1,2,5,12,35} {1,1,3,7,22,1} } #declare pattrn = pat_array [n_sides_rand][n_tiles_rand] ; #declare shp_ptr_ex = int(3*rand(rnd)) ;// 0, 1 or 2; Not used for hexagon. #declare shp_ptr_in = int(3*rand(rnd)) ; // 0, 1 or 2 // 0, 1 or 2, (3 for square only) copies the look of interior for some additional variations. #declare frm = int(4*rand(rnd)) ; #declare colour_mp_n = 1+int(9*rand(rnd)) ; #declare freq = int(3*rand(rnd)) ; //------------------------------------------------------------------------------------ box { #if (SHOW_PARAMS=on) <-1.25, -2, 0>, #else <-5, -2, 0>, #end <0.5, 1, 0> texture { pigment { pavement number_of_sides n_sides number_of_tiles n_tiles pattern pattrn // maximum depends from number_of_sides and number_of_tiles // shape of the corners: 0 sharp, 1 = bevelled, 2 = rounded exterior shp_ptr_ex interior shp_ptr_in form frm clr_mp(colour_mp_n) frequency freq turbulence 0 scale 1/6 rotate x*90 rotate z*360*rand(rnd) // rotate<-90,0,0> // align to xy plane } // end pigment ------------------------------------------------------------------------ finish { ambient 1.0 diffuse 0.0 } } translate <1,0,0> } #if (SHOW_PARAMS=on) //------------------------------------------------------ union { text { ttf "arial.ttf", concat ("Number of sides: ",str(n_sides,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,.60,0.00 > } text { ttf "arial.ttf", concat ("Number of tiles: ",str(n_tiles,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,.48,0.00 > } text { ttf "arial.ttf", concat ("Pattern: ",str(pattrn,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,.36,0.00 > } text { ttf "arial.ttf", concat ("Exterior: ",str(shp_ptr_ex,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,.24,0.00 > } text { ttf "arial.ttf", concat ("Interior: ",str(shp_ptr_in,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,.12,0.00 > } text { ttf "arial.ttf", concat ("Form: ",str(frm,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,0,0.00 > } text { ttf "arial.ttf", concat ("colour_map: ",str(colour_mp_n,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,-.12,0.00 > } text { ttf "arial.ttf", concat ("frequency: ",str(freq,0,0)), 0.02, 0.0 scale<1,1.25,1>*0.095 translate<-1.25,-.24,0.00 > } texture{ pigment{ color rgb<0,0,0> } finish { ambient 1 } } // end of texture } #end #write(Wrt_Params, "File named: \"pavm_test_", str(clock,-3,0), ".png\"\n", "pigment {\n pavement\n", " number_of_sides " str(n_sides,0,0),"\n", " number_of_tiles " str(n_tiles,0,0),"\n", " pattern " str(pattrn,0,0),"\n", " exterior ",str(shp_ptr_ex,0,0),"\n", " interior ",str(shp_ptr_in,0,0),"\n", " form " str(frm,0,0),"\n", " clr_mp ("str(colour_mp_n,0,0)")\n" " frequency "str(freq,0,0)"\n" " scale 1/6\n rotate x*90\n }\n--------------------------------\n" ) #fclose Wrt_Params