// $ver RandScen.pov version 3.0 (2000 - 2001) for povray 3.1 // mods: // o Create temp file instead of direct render, // o allowance for rseed to be passed from a calling master // random program // o conversion to povray 3.1 syntax) by Peter Capasso. // // based heavily on: // // RandScene -- use the clock value to generate a random scene // (C) 8/1997 Christian Perle #ifndef (ntsc) // unless you are rendeing for ntsc amiga, ntsc DCTV, leave this "false" #declare ntsc = false; #end #declare txtr_output_file = "try.pov" #fopen _txtr_file txtr_output_file write #if (ntsc = true) #write(_txtr_file, "#declare ntsc = true;\n\n\n") #else #write(_txtr_file, "#declare ntsc = false;\n\n\n") #end #ifndef (rseed) #declare A = seed(24036293); // initialize random number generator #else #declare A = seed(rand(rseed) * 99999999); #end #write(_txtr_file, "camera {\n") #write(_txtr_file, " location <", rand(A)*10-5, ", ", rand(A)*10-5, ", -15>\n") #write(_txtr_file, " direction 1.5*z\n") #write(_txtr_file, " #if (ntsc = true)\n") #write(_txtr_file, " right <(640 / 400) * (10/11), 0, 0>\n") #write(_txtr_file, " #else\n") #write(_txtr_file, " right <(640 / 480), 0, 0>\n") #write(_txtr_file, " #end\n") #write(_txtr_file, " up <0, 1, 0>\n") #write(_txtr_file, " look_at <0, 0, 0>\n") #write(_txtr_file, "}\n\n\n") #declare Textur = int(rand(A)*11); #macro prt_triple(this_t) // print a triple to a string, return the string #local ttt = <0, 0, 0> + this_t; // force it to be a triple if it is not #local prt_str = concat("<", str(ttt.x, 0, 4), ", ", str(ttt.y, 0, 4), ", ", str(ttt.z, 0, 4), ">") prt_str #end #write(_txtr_file, "sky_sphere {\n") #write(_txtr_file, " pigment {\n") #switch (Textur) #case (0) #write(_txtr_file, " bozo\n") #break #case (1) #write(_txtr_file, " agate\n") #break #case (2) #write(_txtr_file, " marble\n") #break #case (3) #write(_txtr_file, " crackle\n") #break #case (4) #write(_txtr_file, " onion\n") #break #case (5) #write(_txtr_file, " radial\n") #break #case (6) #write(_txtr_file, " granite\n") #break #case (7) #write(_txtr_file, " wrinkles\n") #break #case (8) #write(_txtr_file, " waves\n") #break #case (9) #write(_txtr_file, " quilted\n") #render "\nquilted!\n" #break #else // default case #write(_txtr_file, " ripples\n") #break #end #declare rturb = rand(A); #write(_txtr_file, " turbulence ", rturb, "\n") #declare tscale = ; #write(_txtr_file, " scale ", tscale, "\n") #write(_txtr_file, " color_map {\n") #declare rcolor = ; #write(_txtr_file, " [ 0 color rgb ", rcolor, " ]\n") #declare rcolor = ; #write(_txtr_file, " [ 0.7 color rgb ", rcolor, " ]\n") #declare rcolor = ; #write(_txtr_file, " [ 1 color rgb ", rcolor, " ]\n") #write(_txtr_file, " }\n") #write(_txtr_file, " }\n") #write(_txtr_file, "}\n\n\n") #declare Count = 0; #while (Count < 4) #write(_txtr_file, "light_source {\n") #write(_txtr_file, " <", rand(A)*100-50, ", ", rand(A)*100-50, ", ", rand(A)*100-50, ">\n") #write(_txtr_file, " color rgb <", rand(A), ", ", rand(A), ", ", rand(A), ">\n") #write(_txtr_file, "}\n\n\n") #declare Count = Count + 1; #end #declare Count = 0; #while (Count<10) #write(_txtr_file, "sphere {\n") #write(_txtr_file, " <", rand(A)*20-10, ", ", rand(A)*20-10, ", ", rand(A)*20-10, ">, ", rand(A)*3+0.1, "\n") #write(_txtr_file, " pigment { color rgb <", rand(A), ", ", rand(A), ", ", rand(A), "> }\n") #write(_txtr_file, " finish {\n") #write(_txtr_file, " phong ", rand(A), "\n") #write(_txtr_file, " phong_size ", rand(A)*80+1, "\n") #write(_txtr_file, " reflection ", rand(A), "\n") #write(_txtr_file, " brilliance ", rand(A)*9+1, "\n") #if (rand(A)>.5) #write(_txtr_file, " metallic\n") #end #write(_txtr_file, " }\n") #write(_txtr_file, "}\n\n\n") #declare Count = Count+1; #end #fclose _txtr_file #include "try.pov" /* actual end of this file */