«

»

Feb 18 2013

Generating Planets – Part Three – Traversing The Grid

A major problem with our subdivided icosahedron is that its a lot harder to move around the grid than it is with a simple square grid. Where in the latter you just increase the x or y co-ordinates to move through the array, our problem requires a more complex solution, one regrettably more complex than the solutions to the previous problem we have encountered.

Being able to move around the grid is an important feature for improving our planet as it will allow us to implement pathfinding which has uses in generation such as plotting the path of a river.

traversinganicosahedron

Source: RJ Mathar (http://www.mpia-hd.mpg.de/~mathar/) via Wikipedia. Image modified by myself.

So, back to implementing this method. There is really only one resource I could find on how to traverse a subdivided icosahedron, this paper by Michael Lee and Hanan Smith from the University of Maryland.

Below is the code I created following the method described in the paper. Academic papers like this can be heavy going, especially for people without a computer science degree background (like myself) and so the best way for you to understand how it works is to firstly read the paper, and then look at the code. Hopefully together they will start to make sense. Link.

Leave a Reply

Your email address will not be published. Required fields are marked *


× eight = 8

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>