|
|
Hi people,
I just wrote a formula-generator for an iso-surface to generate sea-surfaces.
It parameters for the count of waves the size for the biggest and smallest,
their speed and direction.
Have fun,
Holger Karsten
//################################################################
// PoVRay 3.7 Scene File "Sea_test.pov"
// author: Holger Karsten
// date: 23th November 2011
// CC
//--------------------------------------------------------------------------
#version 3.7;// runs from 3.5 up
camera {
angle 75
location <10,10,-30>
right x*image_width/image_height
look_at 0
/*
aperture .1
blur_samples 4
focal_point <0,0,100000>
confidence 0.95
variance 1/16384
*/
}
light_source{<10,100000,300000> color rgb 1}
light_source{<10,10,-30> color rgb .2} //same as the camera to do ambient light
sky_sphere {
pigment{
gradient <0,1,0>
color_map {
[0.00 rgb 0]//<0.6,0.7,1.0>]
[0.35 rgb 0]//<0.1,0.0,0.8>]
[0.45 rgb <0.1,0.0,0.8>/2]
[0.00/2+0.5 rgb <0.6,0.7,1.0>]
[0.35/2+0.5 rgb <0.1,0.0,0.8>]
[0.65/2+0.5 rgb <0.1,0.0,0.8>]
[1.00/2+0.5 rgb <0.6,0.7,1.0>]
}
translate y/2 scale 2
}
}
#declare Size_of_surface=700;
#declare NumberOfWaves=5;
#declare Scale_for_biggest_wave =<10,4,35>;
#declare Scale_for_smallest_wave=<0.5,.15,0.5>;
#declare Direction_for_biggest_wave =<0.025,0,0>;
#declare Direction_for_smallest_wave =<0.025,0.1,0>;
#declare Scaling_down_the_values =1.15; // adjust when values for smallest
// waves take place (1=take place
// at smallest wave >1 take place
// before)
#declare Radius=7; //(sphere)
#declare Water=true;
#declare Ball=true;
#declare High_scale=spline{linear_spline
1 <Scale_for_biggest_wave.y,0>
NumberOfWaves/Scaling_down_the_values <Scale_for_smallest_wave.y,0>}
#declare Wide_scale=spline{linear_spline
1 Scale_for_biggest_wave
NumberOfWaves/Scaling_down_the_values Scale_for_smallest_wave}
#declare Direction=spline{linear_spline
1 Direction_for_biggest_wave
NumberOfWaves/Scaling_down_the_values Direction_for_smallest_wave}
#declare Timing=spline{linear_spline
1 <frame_number/10 ,0>
NumberOfWaves/Scaling_down_the_values <frame_number/1,0>}
#declare noise=function{internal(76)}
#declare Seed=seed(2762347);
#declare SeaSurface=isosurface {
function {y
#declare Gt=1;
#while (Gt<NumberOfWaves)
#declare Z=1000*rand(Seed);
#declare F=High_scale(Gt).u;
#declare Spd=Timing(Gt).u;
#declare Drc=Direction(Gt)*Timing(NumberOfWaves-Gt).u;
#declare Dx=Drc.x;
#declare Dy=Drc.y;
#declare Dz=Drc.z;
#declare WSx=Wide_scale(Gt).x;
#declare WSz=Wide_scale(Gt).z;
+noise(x/WSx+Z+Dx,Dy,z/WSz+Z+Dz)*F
#declare Gt=Gt+1;
#end
}
max_gradient 1
contained_by {box {
<-Size_of_surface,-8,-Size_of_surface>,
<Size_of_surface,8,Size_of_surface>
}}
interior{ior 1.32}
texture {
pigment{color
rgb 0}
finish{specular 1 roughness 0.0025 reflection{0.1,1.1 fresnel on}ambient 0
diffuse 1}
normal{granite -.125 scale 4}
}}
#declare Loc=trace(SeaSurface,<0,10,0>,<0,-10,0>);
#declare Locy=Loc.y+Radius/1.25;
#declare Rotation=<11,22,33>;
#declare R=1;
#while (R<(frame_number+2))
#declare
Rotation=Rotation+<rand(Seed)*.1,rand(Seed)*.1,rand(Seed)*.1>-<0.025,0.05,0.1>*1.5;
#declare R=R+1;
#end
#if (Water)
object{SeaSurface}
#end
#if (Ball)
sphere {
0,Radius/1.1
interior{ior 1.25}
texture {
pigment {
radial
frequency 8
color_map {
[0.00 color rgb <1.0,0.4,0.2> ]
[0.33 color rgb <0.2,0.4,1.0> ]
[0.66 color rgb <0.4,1.0,0.2> ]
[1.00 color rgb <1.0,0.4,0.2> ]
}
}
finish{
ambient 0 diffuse 1
reflection {0,1.5 fresnel on}
}
}
rotate Rotation
#declare P=Loc+Radius/1.4;
translate P*y
}
#end
Post a reply to this message
Attachments:
Download 'sea-test.gif' (1518 KB)
Preview of image 'sea-test.gif'
|
|