Wednesday, November 25, 2009

New background image for the header

This weekend I spared some time to finally play with the background image of the header.
The algorithm was this: I put random rectangles on the terrain (increasing the height of its points by 1) until somewhere the height reached 255. (The result was more satisfying than I first thought.)
After this I tried to create the lines.
The first try was a simple modulo, if the height at a given point is the multiple for instance 25, there will be a gray point on the map. This is the result:

As you can see, it's like a galaxy.. not a map. The lines are not really connected. The shape can be seen, but still...
So, the next approach was: check the neighbours, and if there is a difference in height by modulo 25, we'll draw a gray point.
Result:

Much better! But the lines are too thick.. an edge detection will solve the problem: you'll only check a certain point, and only one of its neighbours: the uppermost.
Result:
And the final version, which we are using now as a background:
It makes the small text quite unreadable, but at least we have something like a map. I'll play some more with this, maybe I'll use only an image, putting on it red or blue text, so it will be more readable.

No comments: