The diamond-square algorithm is a method for generating heightmaps for computer graphics and can be used to procedurally generate realistic landscapes. It is also known as the random midpoint displacement fractal, the cloud fractal or the plasma fractal.
- The diamond step: For each square in the array, set the midpoint of that square to be the average of the four corner points plus a random value.
- The square step: For each diamond in the array, set the midpoint of that diamond to be the average of the four corner points plus a random value.
![]() |
![]() |
---|---|
Heightmap | Mesh |