Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Geometric Shapes in POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
Geometric Shapes
   Index
Basic Shapes
Shapes by macro + CSG
Shapes in "shapes3.inc"
Other Shapes by macros
3D text shapes
Other Shapes
Non CSG Shapes

height_field + HF macros
  - height_field by images
  - height_field rastered
  - height_field by functions
  - height_fields massiv
  >HF - Mountain + Valley
  - HF_Square
  - HF_Sphere
  - HF_Cylinder
  - HF_Torus

Isosurfaces
                                   
Sample height_field by_functions Sample height_field by_functions

"height_field" massiv

Locally limited "height_field" and
massiv "height_field"-body


We can get a locally limited "height_field" i.e.
by overlapping of a "height_field" function with one of
the special pattern functions "spherical" and "boxed":

#declare HF_Res_X = 1024; // number of points in x
#declare HF_Res_Z = 1024; // number of points in z
#declare SF =
 function {
   pigment {
   spherical
     color_map {
       [0.0, color 0.0 ]
       [0.5, color 0.5 ]
       [1.0, color 1.0 ]
     } // end color_map
    scale <0.5,1,0.5>
    translate<0.5,0,0.5>
   } // end pigment
 } // end function

#declare HF_Function   =
 function(x, y, z)
  {1+f_snoise3d(x*10,y*10,z*10)*0.3 * SF(x,y,z).gray}

#declare HF_Amplitude    = 0.5;
#declare D = 0.00001; // just a little bit!

height_field{
  function  HF_Res_X, HF_Res_Z
  { HF_Function(x,0,y) * HF_Amplitude }
  //smooth
  //water_level 0
  translate<0,-0.42,0>
  scale <1,1,1>
  texture { pigment{ color rgb<0.96,0.87,0.73>}
            normal{ bumps 0.25 scale 0.005 }
          } // end of texture
}//------------------------------------------------ 
 
f_noise Funktion   +   spherical pattern

 
"height_field" by the function
function{1+f_snoise3d(x*10,y*10,z*10)*0.3
multiplied with spherical pattern function
"height_field" durch die Funktion
function{1+f_snoise3d(x*10,y*10,z*10)*0.3
multiplied with boxed pattern function

How to create a massiv "height_field" body:

A "height_field" itself is only a thin skin out of triangles - a mesh.
If we need a massiv body for CSG operationen ("union","merge","difference" or "intersection") we can get this by converting the "height_field" to a massiv block with "height_field" surface by "intersection" with a "box".

#declare HF_Res_X = 1024; // number of points in x
#declare HF_Res_Z = 1024; // number of points in z
#declare HF_Function  = function{0.1+0.1*sin(x*30)}
#declare HF_Amplitude = 0.25;
#declare D = 0.00001; // just a little bit!

intersection{
  height_field{
    function  HF_Res_X, HF_Res_Z
    { HF_Function(x,0,y) * HF_Amplitude }
    //smooth
    //water_level 0
    translate<0,D,0>
  } // end HF
  box{ <D,-0.2,D>,<1-D,0.2-D,1-D>
  } // end box

 texture { pigment{ color rgb<0.75,0.5,1> }
           finish { phong 1 }
         } // end of texture
 translate<0,0.21,0>
 scale <1,1,1>
}// end intersection ------------------------------ 
 
 
 
 
Massiv "height_field" of function
by "intersection" with "box"

© Friedrich A. Lohmüller, 2014
www.f-lohmueller.de
  top