Saturday, 22 June 2013

Diamond Square Algorithm

One of my favourite areas of computer graphics is landscape generation. During the September 2012 PyWeek I was able to try out the Diamond square algorithm for my Mars based game. Just a simple zap-zap affair I'm afraid!

I was curious to see how Dart would cope with this number crunching task. Of course, it worked well :-)

Turns out it works well - you can try the demo here- it redraws every second. There's a bit of work to be done to tidy up the edges slightly but for a first iteration it works well enough.

The basic code for the HTML and class are on github - add to a WebUI project to get up and running.