Fractal landscapes are often generated using a technique called spatial subdivision. For magical reasons this results in surfaces that are similar in appearance to the earths terrain.
The idea behind spatial subdivision is quite simple. Consider a square on the x-y plane,
- (1) split the square up into a 2x2 grid
- (2) vertically perturb each of the 5 new vertices by a random amount
- (3) repeat this process for each new square decreasing the pertubation each iteration.
The controls normally available when generating such landscapes are:
- * A seed for the random number generator. This starts the rundom number generator and means that the same landscape can be recreated by remembering only one number.
- * A roughness parameter. This is normally the factor by which the perturbations are reduced on each iteration. A factor of 2 is the usual default, lower values result in a rougher terrain, higher values result in a smoother surface.
- * The initial perturbation amount. This set the overall height of the landscape.
- * Initial points. It is often desirable to specify some initial points, normally on the corners of the initial rectangles. This provides some degree of control over the macro appearance of the landscape.
- * Sea level. This "flood" the terrain to a particular level simulating the water level.
- * Colour ramp. This is used for shading of the terrain surface based on the height. Normally two or three colours are defined for particular heights, the surface at other heights is linearly interpolated from these points.
- * Number of iterations. This results in the density of the mesh that results from the iteration process.
An application that creates fractal landscapes has been written by myself called FracHill. It fully implements fractal terrain generation including control over (x,y) range, sea colour, background colour, terrain colour ramp, lighting, rendering options, camera attributes, grid density, 9 initial points, height variation, and roughness.
This application runs on any Macintosh computer with colour QuickDraw. It supports image saving to PICT files and colour printing through the standard Apple printing mechanism.
It also has the ability to geometrically morph between any two terrain models, images or models can be automatically exported and formed into animation sequences.
FracHill was primarily written as a creator of terrain models for other 3D modelling and rendering packages and thus provides the ability to export the land surface in a number of CAD formats so that it can be imported into 3D modelling packages.
At the time of writing it exports to the following file formats
The following shows a terrain surface at various grid resolutions from 2x2 to 32x32.
In addition to wireframe views, FracHill performs other types of rendering including
Some examples directly from FracHill are shown below
A well known artifact (bug) with terrains generated this way is the appearance of "seams" or "creases". These generally occur along the edges of the geometry associated with early iterations. A clear example is shown below, notice the crease in the bottom left part of the terrain highlighted by the shadow zone:
Heinz-Otto and Dietmar Saupe, The Science of Fractal Images, Springer-Verlag
The Synthesis and Rendering or Eroded Fractal Terrains, F.Kenton Musgrave, Craig E Kolb, Robert S. Mace, IEEE Computer Graphics & Applications