I have implemented functions that can draw any polygonal shape, however I have been unable to generate a smooth shape that mimics the rounded edges of a lake. I tried generating two circles and joining the edges but there is not enough variation or smoothness to it. Does anyone have any pointers or ideas that could generate a shape like this?
|
|
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like. |
|||||
|
|
You could use a Perlin Noise algorithm to generate the lakes for you, if you are using a top down view (polygon shape, sounds like you are), this guy from Stanford did just that. http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/ |
|||||||
|
|
One way would be to start with a basic polygon, maybe your 2 circles approach. Firstly offset all points randomly, so doesn't look too much like a circle, then for every edge, split it in 2 and offset the middle point by some small random amount. Keep doing this until you have the required detail. |
|||
|
|
