Maps, again

During these holidays I played a little bit with a couple of ideas, including a “civilization-like” game. I used JRuby.

I started using a dataset of elevation (the SRTM 90m). In practice you get a big matrix with the elevation in meters of a point each 90 meters.

If you draw altitude 0 as pure black and altitude 4000 as pure white you get something like that.

If you represent different elevations with different color (for example you choose green for 0-400 m, brown for 400-2000, and white for 2000 m) you get something like that:

The code to do that is this:

But if you add some simple code to represent shadows (supposing sun come from north-west) the result improves a lot:

The code to get this effect is here:


Add Comment Register

Leave a Reply

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

three + = 7

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