Theory

Fractals:

Fractals is short for "fractional dimensional" and it represents the various forms of self-simliar curves. The term fractal has become widely associated in graphics with randomly generated curves and surfaces that exhibit a degree of self-similarity. They are used to provide "naturalistic" shapes for representing objects such as coast-lines, rugged mountains, grass, and fire.

Fractal Geometry is a term used by Benoit Mandelbrot. The term was used to describe the attributes of certain natural phenomena, for example coastlines.A coastline viewed at any level of detail - at microscopic level, at a level where individual rocks can be seen or at a "geographical" level - tends to exhibit the same level of ruggedness; a kind of statistical self-similarity. Fractal geometry provides a description for certain aspects of this ubiquitous phenomenon in nature and its tendency towards self-similarity.



How the landscape is generated:

      This section explains how the Fractal landscape surface is generated. The basic idea is to have the initial surface represented as a 2D grid with 9 control points on it, which are responsible for the final shape of the generated landscape. The user is able to manipulate the initial surface control points as well as other parameters such as Surface Seed and Surface Roughness which determine the shape of the final landscape.


      From the initial 9 "control points" given by the user the program generates a full grid of 4225 (ie 65 X 65) control points which are interpolated so that the final outcome is similar to the basic 3 x 3 grid.

      Before we go ahead in this topic I would like to explain in detail what is meant by the term refine. To refine a grid in this context is to expand it almost two times (ie a N x N grid becomes 2*N-1 x 2*N-1 grid) with the new points in the grid being initialized to the average of the 4 neighbours in the case of a central point or the average of the 3 neighbours in case the point lies on the edge of the grid.


      Here Pt. ABCD is the average of its four neighbours viz. AB, AD, BE, and DE.


      In a similar way the point AB in the above case is calculated as the average of A, B and ABDE.
This process is called refinement/interpolation of the grid. So in this way the initial 3 x 3 grid is refined iteratively 5 times to get a 65 X 65 surface.


      After refining the grid at each step we add a small amount of noise to each point in the grid so that it would result in jagginess and in effect look more like a natural landscape.

      The noise function used in this case to generate the "natural jagginess / ruggedness" for the surface is :


New_Value=Old_value+(0.5-random(Seed))*(pow(0.5,(Surface_Roughness+iteration))

Where:

           New_Value = The calculated value of a point in the grid based on the its neighbours value.

           Old_Value = The Value that is associated at that control point during the initialization or when calculated during the refinement of the grid.

           random() = A random function that generates a random number based on the Surface Seed which can be controlled by the user.

           And finally Surface Roughness is another parameter that determines the ruggedness of the landscape. This also is controlled by the user.

      On the whole we have a application that generates a natural landscape surface with all the controls in the hands of the user. Another important and interesting feature about this application is that since it is in Java which is a dynamic and interactive language, the user can orient the final generated landscape in any direction with the help of the mouse and get a clear visual concept of what is going on.