Blogs from friends
Programming and Software Development Guru
  • A tech blog recommendation

    I recently came across this blog in my web travels. The guy is a self described C++ hater, but also a C++ (and many other languages) super-genius, being a developer of compilers and debuggers and stuff for embedded C and C++ developers in the automotive industry. His articles aren’t too focused...

  • Stay in Sync with GCal and Thunderbird.

    For a long time I have been looking for a rock solid calendaring system. I’ve gotten too used to working for companies who have Microsoft Exchange (or, God forbid, Scalix) installed which allow me to edit and update a calendar from multiple locations and even sync...

  • Software RAID 5 in Ubuntu with mdadm

    Software RAID in Linux is a great way to gain massive amounts of disk space which are required for storing digital media, with the added security of data redundancy incase one of the disks in the array fail. Many people still frown upon software RAID...

The Escapist

The Escapist Forums : Threads
  • Best video game song ever made? Big boys leage: no favorites.


  • Should the ESRB introduce a T15+ rating?

    The whole ESRB thing in general is kind of dumb. At most they should just take the content labels and stick them on without the rating.

    Its literally just a marketing gimmick for publishers at this point. They pick their demographic and mangle up the game as needed to get the label for that demographic. Which I can only imagine becoming worse and more pronounced if it gets even more sectioned.


    Now we just wait for Religion and Politics to get nuked then, huzzah!

Voronoi tiling art PDF Print E-mail
Written by Mat   
Wednesday, 30 September 2009 20:23

These tessellations have all been generated by a very simple FreeBASIC program that I wrote.

I stumbled upon this algorithm while searching for a way to generate stochastic terrain heightmaps for a 3D strategy game, and realised that it could be made to produce pretty 2D pictures.

See: Voronoi diagram at Wikipedia.

The algorithm is as follows: start by placing a number of control points in random positions in the image, and assign each one a primary colour. Then for each pixel of the image, the colour of that pixel is set to the colour of its nearest control point, and the brightness of the pixel is set to the difference between the distance from the pixel to its nearest control point and the distance from the pixel to its next nearest control point.

Numerous variations on the algorithm exist: instead of using control points, other geometric objects can be used such as line segments or circles, which both result in curved edges. Also, instead of using Pythagoras to compute the distances, other methods can be used such as the Manhattan metric or the chessboard metric, and these result in more right angles.

It is possible to achieve a finer granularity in the spectrum of colours used, by mixing together two or more layers of tilings with various weights and numbers of control points.

Tiling Tiling Tiling
Tiling Tiling Tiling
Tiling Tiling Tiling

Last Updated on Thursday, 01 October 2009 20:12