#version unofficial 3.8; // yuqk #if (file_exists("version.inc")) #include "version.inc" #end #if (!defined(Fork_yuqk)) #error "This POV-Ray SDL code requires the yuqk fork." #end global_settings { assumed_gamma 1 } // Curious example seeds from our documentation... // wiki.povray.org/content/Reference:Numeric_Expressions#Functions #debug "\n--------------------------------\n" #declare R1 = seed(0); #declare R2 = seed(12345); #debug concat(str(R1,1,3), " seedStreamNum ", str(R2,1,3),"\n") #for (I,1,4) #debug concat(str(rand(R1),1,3), " ", str(rand(R2),1,3),"\n") #end // 0.000 seedStreamNum 1.000 // 0.000 0.467 R2 stream one value/index ahead of R1 // 0.467 0.249 given the seed values 0 and 12345 // 0.249 0.966 // 0.966 0.637 #debug "\n--------------------------------\n" // Using yuqk's f_hash() inbuilt for streams // f_hash(value,seed,step,0 to 1 or -1 to 1 return ranges) #include "functions.inc" #declare S1 = 1.2345; #declare S2 = 6.7890; #for (I,1,4) #debug concat(str(f_hash(I,S1,0,0),1,3), " ", str(f_hash(I,S2,0,0),1,3),"\n") #end // 0.032 0.482 // 0.969 0.844 // 0.256 0.294 // 0.094 0.887 #debug "\n--------------------------------\n"