|
|
from the posting in binaries.images
#version unofficial MegaPov 0.4;
#include "colors.inc"
light_source{<0,0,0> color rgb<1,1,1> translate <-30, 200, -300>}
camera{location <0, 10, -250> look_at <0, 0, 0>}
sky_sphere
{
pigment
{
gradient y
color_map { [0.0 color rgb <0.7,0.7,1.0>] [1.0 color blue 0.5] }
}
}
// ----------------------------------------
#macro snow_blobs()
#declare high_x = 0;
#declare low_x = 100;
#declare high_z = 0;
#declare low_z = 100;
#declare R_Val = 0.1;
#declare S_Val = 1.0;
#declare R1 = seed(123);
#declare R2 = seed(456);
#declare R3 = seed(789);
#declare R4 = seed(987);
#declare R5 = seed(654);
#declare x_count = 6;
#while (x_count < 15)
#declare z_count = 0;
#while (z_count < 7)
#declare norm_reg = <0,0,0>;
#declare trace_result =
trace(near_range, <x_count-10.5, 100, z_count>, <x_count-10.5, -100,
z_count>, norm_reg);
#if ((trace_result.y/5) + norm_reg.y > 1.50)
sphere {
<0,0,0>, R_Val, S_Val
scale <0.5+(rand(R1)/2),0.5+(rand(R2)/2),0.5+(rand(R3)/2)>
translate trace_result
}
#if (x_count < low_x) #declare low_x = x_count; #end
#if (z_count < low_z) #declare low_z = z_count; #end
#if (x_count > high_x) #declare high_x = x_count; #end
#if (z_count > high_z) #declare high_z = z_count; #end
#end
#declare z_count = z_count + 0.025 + (rand(R4)/100) - 0.005;
#end
#declare x_count = x_count + 0.025 + (rand(R5)/100) - 0.005;
#debug concat("x count: ", str(x_count, 2,3), "\n")
#end
#debug concat ("high x: ", str(high_x, 2,3), "\n", "high z: ", str(high_z,
2,3), "\n", "low x: ", str(low_x, 2,3), "\n", "low z: ", str(low_z, 2,3),
"\n")
#end
#declare rock_texture =
texture{
pigment{rgb<0.4, 0.3, 0.3>}
normal{granite 2 scale 0.05 turbulence 0.5}
}
#declare near_range =
height_field
{
tga // the file type to read (gif/tga/pot/pgm/ppm/png/sys)
"near_range.tga" // the file name to read
smooth
texture{rock_texture}
translate <-0.5,0,0> // center
scale <21,10,5>
}
object {near_range translate <0.5,2.5,-245>}
blob
{
threshold 0.5
snow_blobs()
texture{
pigment{rgb<0.9,0.9,1.1>}
finish{ambient 0.10 diffuse 0.85}
}
translate <0.5,2.5,-245>
}
--
Tom Melly
tom### [at] tomandluforce9couk
http://www.tomandlu.force9.co.uk
Post a reply to this message
|
|