## Articles/Works about my researchArticles and application programs about Software Engineering, Human-Computer Interaction, Computer Graphics, etc. |

« Top |

A simple fractal landscape generation algorithm/CG.

Overview

The worlds generated by fractal algorithm. Basic Algorithm

1. Create an array, whose size is 2^n+1, and clear it with zero.For example, here I create 9x9 array (n=3) as below.

2. The first "step number" is 4. (a half of initial array size: 4==floor(9/2) or 2^(n-1))

3. Generate random number for points whose coordinate is divisible by 4.

4. Next "step number" is 2. (a half of 4).

5. For each points, calculate number as arithmetical average of points around.

And change slightly by adding or subtracting random number.

6. Repeat until "step number" becomes 1.

Sample outputs

World1

Using each points as height and paint it according to its height. Cloud-1

Using each points as value of brightness Cloud-2 (Tiled)

When calculating edge of points, calculate average with opposite side of array as if it is continual.Then, you can arrange the image as a tile. Here 2x2 images combined.

- Search
Recent Entries [-] - 1671