Monday, September 17, 2018

Grasslands (Part 3)

(Note:  This was actually posted out of order with #4.)

At the end of the last posting, I had a basic grassland/swamp symbol working, and was able to place it on the map in a reasonable way.  The basic symbol looks like this:
In this posting I'll look at adding some variation/interest to the generation of the symbol.

The first step is to vary the size of the symbol to be wider or narrower and have fewer or more “blades" of grass.  If you examine this example use:
you can see that the individual symbols have anywhere from three to ten blades.  There are a couple of ways I could program this variation.  I could pick a random width and then figure out how many blades could fit, or I could pick the number of blades and let that determine the width.  Either choice will be made more complicated if I allow the size of the blades and the gap between them to vary.  At any rate, I chose to pick a random number of blades and then let that determine the width.
The number of blades is chosen at random.  But a random distribution -- where every number of blades is equally likely -- is probably not the most realistic/artistic.  A better distribution would be weighted toward the middle of the range, so if I allow (say) 3-8 blades, most of the clumps will be 5 or 6.
I can also add some variation to the arch of each clump.
(I don't want to let the bottom get completely flat, since that will be the basis for the marsh symbol.)

Another tweak is to make the top curve a little asymmetric.  This is accomplished by moving the control point of the Bezier curve a little bit off-center.
As you can see, a few of the symbols now have a bit of a sway to the right or the left.

Likewise, I can tweak the individual blades a bit to either side so the spacing isn't quite so mechanical.
This has a pretty big impact on making the symbols look more hand-drawn.  If you compare the map-sized symbols in this picture with the one above you'll see that the ones above look much more mechanical.

I can vary the line width in a similar way.
Here I'm just varying the starting width of the stroke -- they all taper off to zero.

Finally, I can make the individual blades a little shorter or longer on either end.
The last (?) thing I'll do is add a little arc to the blades.  This is probably overkill at map scale (not that overkill has ever stopped me before) but is at any rate easy enough to try out.  Bending the blades just requires turning the straight blade lines into arced ones using the same quadratic Bezier curve routine I've used previously.
Here I've just used the same offset for every blade.  Which is good for producing eyelashes but maybe not so good for grass.  I need to make the offset switch over at the middle of the icon, so that all the grass bends away from the middle.
I'm not using too much “bend" here but it does give the grass a more lifelike look.  Here's a side-by-side comparison between the original symbols and the “hand-drawn" symbols:
Next time (actually last time) I'll take a look at using these symbols on the map.

No comments:

Post a Comment