Friday, May 4, 2018

Diamond Square Algorithm in C/C++

I have implemented the Diamond Square Algorithm as depicted in this site =>https://www.bluh.org/code-the-diamond-square-algorithm/
It is a way of generating height maps for computer graphics. These height maps can be used as textures or landscapes. It is a slightly better algorithm than the three-dimensional implementation of the midpoint displacement algorithm which produces two-dimensional landscapes. It is also known as the random midpoint displacement fractal, the cloud fractal or the plasma fractal, because of the plasma effect produced when applied.


I chanced upon this topic while searching for Fractal Terrain Generation.

Snapshots:


Here is the code.

No comments:

Post a Comment