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

- POV-Ray Tutorial
Geometric Shapes
Basic Shapes
Shapes by macro + CSG
Shapes in ""
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

Sample mountains by height_field

With "height_field"
over Hill and Dale

How to make a "height_field" Landscape

A Landscape by "height_field" with Mountains and Valleys:

If we put a pure "height_field" mountain right on the basic plane, we can see only the tops of the mountains emerging from the flat ground, the valleys are absent !!!
Looks like they were filled by drifting sand!
If we want to see additionaly the valleys, we have to be sure that there is not so much sand dust round here. We have to do the dusting well!-)
We will be successful in this by the following 3 steps shown by the images here in the right column:

#declare HF_Res_X = 1024; // number of points in x
#declare HF_Res_Z = 1024; // number of points in z
#declare SF =
 function {
   pigment {
     color_map {
       [0.0, color 0.0 ]
       [0.5, color 0.8 ]
       [1.0, color 1.0 ]
     } // end color_map
    scale <0.5,1,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!

union{ // height_field + ground
   function  HF_Res_X, HF_Res_Z
   { HF_Function(x,0,y) * HF_Amplitude }
    translate<0,D-0.4 ,0>
   } // end HF
  box{ <D,-0.10,D>,<1-D,0.2-D,1-D>
   } // end box
 } // end intersection

difference{ // ground minus hole for height_field
 plane { <0,1,0>, 0 }   // plane of the ground
 box{ <D,-0.10,D>,<1-D,0.2-D,1-D> }
 } // end difference

 scale <1,1,1>
 texture { pigment{ color rgb<1,0.95,0.8>}
           normal { bumps 0.75 scale 0.0025 }
           finish { phong 0.1 }
         }// end texture

}// end of  height_field + ground ------------- 
Pure "height_field" on the ground:
No valleys to see !!!
Massiv "height_field" by the function
multiplied with boxed pattern function and
"intersection" with "box"
First we have to excavate a hole from the ground!
Then we have to put the massiv "height_field"
in the hole!
Now we have not only mountains, but also valleys!  
Description of the scene for POV-Ray:
"HF_by_function_32.txt" or

© Friedrich A. Lohmüller, 2014