Midpoint Displacement Algorithm

The Midpoint Displacement Algorithm is a method of generating a height map by assigning a height value to each of the four corners of a rectangle, and then subdividing the rectangle and each resulting child into four smaller rectangles, whose heights at the subdivided corners are the average (mean) value between the corners of the parent rectangle. Randomly varying the computed height at each step results in the height map being defined by a plasma fractal.

The Midpoint Displacement Algorithm is in practise usually superseded by the Diamond-Square Algorithm.

Code Example

PCG Wiki References

External Links

Diamond-Square Algorithm - Wikipedia article on the Midpoint Displacement Algorithm.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License