This idea was implemented in a class called
HeightMapMirror
that takes an IHeightMap
as argument. This class also implements the IHeightMapinterface. This means a mirror can now be created from any other height map on the fly - whether that map is generated or whether it is loaded from an image file.
Obviously you can feed the constructor of the new class another instance of a HeightMapMirror effectively creating a 4 x 4 tile (who wouldn't give that a try?)
.
Surprisingly, from an almost featureless patch of a HeightMapPerlin
terrain an interesting and attractive fair playground is produced using this plan . The image shown above is produced that way. Notice the repeating pattern of water and hills.The other thing I did today was to create a
HeightMapIslandTrim
class. Its function is simply to put a coastline on the edge of the heightmap. Like HeightMapMirror (the other modifier of heightmaps) this class constructor also takes another map as source.First I tried a circle island and did not like the loss of real estate. I then tried creating a square island and did not like the look of it too much. I'll experiment more with this when creating a terrain in the context of a game.
The basic idea of adding a coastline is simple: the height is calculated using a linear interpolation that is based on the distance from the edge of the island. This class can also be (ab)used to create a wall around the terrain by specifying impossible values for
waterlevel
or shoreheight
.This concludes today's blog. Not much added, but at least some progress has been made.
No comments:
Post a Comment