return home
Fractals
articles

Fractal Landscapes Generator
written by Felix Golubov. E-mail: FGolubov@aol.com

How does it work?

Shapes of mountains and clouds really are fractals and the algorithm for their generation literally follows the fractals definition.

A fractal is geometric shape that can be subdivided in parts, each of which is (at least approximately) a reduced-size copy of the whole.

Such a fractal-generating algorithm is a very simple one and it is almost the same for mountains as for clouds. Both of them are generated by the recursive procedure that picks random values for the corners of some simple shape and then recursively fractures it to obtain the next shape. The fractured shape for mountain generation is a triangle and each value stands for altitude, whereas the fractured shape for clouds is a rectangle and each node's value should be transformed to color. Random values are averaged with nearest nodes' values so both rock surface and clouds look sufficiently smooth.

What is going on?

At the top part of the applet there is a panel containing three groups of check boxes (such grouped check boxes are known as option buttons or radio buttons).

  1. The first group includes two buttons, labeled Run and Stop . We can use these buttons for running and stopping the animation.
  2. The second group has label Degree and includes three buttons labeled 5, 6 and 7 respectively. This value indicates a power of 2 and corresponds with the number of segments each side of each primary triangle or rectangle is divided to.
    Degree 5 6 7
    Num.segm. 32 64 128

    Each next degree corresponds with two times more number of segments and four times more number of triangles and rectangles then the previous one.
  3. The third group has label Light and includes two buttons labeled Rear and Front respectively. Each of them sets its own (rear and front) direction of lighting.

    More detail for the technically minded

© MathsNet 1999