Jump to content

Diamond squares algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Extransit (talk | contribs) at 15:48, 26 April 2007 (Created page with 'The diamon squares algorithm is used to creat computer generated fractal terrain. The idea was first introduced by Gavin S. P. Miller who described it as fl...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The diamon squares algorithm is used to creat computer generated fractal terrain. The idea was first introduced by Gavin S. P. Miller who described it as flawd. The algorithm starts woith a 2D grid then randomly generates terrain heigh from four seed values aranged in a grid of points so that the entire plane is coverd in squares. The diamond squares is a two step algorythm.

Steps

  • Taking the four seed points that are arranged in a square calculate a new vale where the diagonals would cross by averaging the values of the four points and adding a random amount. There should now be a patter of diamonds across the network.
  • Then do the same with the diagonals of the diamonds and you should have a patter of squares again.