|
|
Patrick Elliott <sel### [at] npgcablecom> wrote:
> I am fining myself in a position where I think I have some code that can
> be used, but I need to "see" it, but the place I plan to use it has
> restrictions, where I can't test it "in world". So, I figured I might be
> able to test it in POVRay, but to see if its working as espected, I need
> to test it against conditions like those its going to be running.
>
Some times ago, I wrote a endless pseudo random landscape scroller.
The code is this:
-------------------------------------------------------
global_settings {
adc_bailout 0.00392157
assumed_gamma 1.5
noise_generator 2
}
background { rgb -.2}
/* sky_sphere {
pigment {
image_map {
png
"/bsys/Textures/Cosmos/Stars_Alphamap.png"
map_type 0
}
}
}
*/
fog {
fog_type 2
distance 1.618
rgb <0.66, 0.66, 0.66>
fog_offset 0
fog_alt 0.4
up <0, 1, 0>
}
union {
#declare Value=0.13;
#declare fn_pattern=
function {
pattern { dents turbulence 0.9 scale 0.15
translate y*5*clock
}
}
height_field {
function 800, 800 { fn_pattern(x, y, 0)*Value + 0.5 }
}
pigment {
uv_mapping
cells
turbulence <1, 1, 1>
omega 1
lambda 6
color_map {
[ 0 color rgb <0.68627, 0.52157, 0.32157> ]
[ 0.95 color rgb <0.21176, 0.23922, 0.26275> ]
[ 0.98 color rgb <0.81569, 0.69412, 0.45098> ]
[ 1 color rgb <0.952941, 0.964706, 0.964706> ]
}
matrix < 5, 0, 0,
-1, 1, 0,
0, 0, 1,
0, 0, 0 >
}
normal {
uv_mapping
cells
5
turbulence <1, 1, 1>
omega 1
lambda 6
matrix < 5, 0, 0,
-1, 1, 0,
0, 0, 1,
0, 0, 0 >
accuracy 0.01
}
scale <8, 6, 6>
rotate <0, 0, 0>
translate <-4, -2.9, -3>
}
light_source {
<4, 5, -5>, rgb <0.9, 0.9, 0.9>
}
light_source {
<-4, 5, -5>, rgb <0.3, 0.3, 0.3>
shadowless
media_interaction off
media_attenuation off
}
camera {
perspective
location <0, 0.52, -3>
sky <0, 1, 0>
direction <0, 0, 1>
right <1.6, 0, 0>
up <0, 1, 0>
look_at <0, 0.7, 50>
angle 56
}
-----------------------------------------------------
It based on a heightfield with a "Dents"-pattern as a
function to the heightfield. IMO a very easy way, to
generate pseudo random landscapes.
Hope it helps.
Post a reply to this message
|
|