Fractal Landscapes Generator
Author: Felix Golubov,
Warner Music Group
E-mail: Felix.Golubov@wmg.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 fractal-generating algorithm is very simple one and it is almost the same as for mountains as for clouds. Both of them are generated by the recursive procedure that pick random values for the corners of some simple shape and then recursively fracture previous shape. The differences are that such fractured shape for mountains generation is triangle and each value stands for altitude, whereas fractured shape for clouds is 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. Degree stands for degree of number 2 and this value corresponds with the number of segments each side of 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 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.
Felix Golubov.
E-mail: FGolubov@aol.com