Overview
The worlds generated by fractal algorithm.
This program is built with KWlib-3D.
Basic Algorithm
- Create array, whose size is 2^n+1, clear with zero. For example, I create 9x9 array as below.
- First "step number" is 4. (half of initial array width).
- Generate random number for points whose coordinate is divisible by 4.
- Next "step number" is 2. (half of 4).
- For each points, calculate number as arithmetical average of points around.
And change slightly by adding random number
- 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.