# Thread: Procedural vector map elements -- some experiments

1. ## Procedural vector map elements -- some experiments

As those who have seen my Challenge entries will know, I'm interested in creating procedurally generated maps, because:
1. I'm far too lazy to do a map manually, and
2. I have no artistic talent anyway.

This thread is for showing my experiments with procedurally-generated map elements, like forests, mountains, cartouche decorations, etc. -- mostly in a hand-drawn- or engraved-style.

First off, I'm looking at forests. I'm going to take the forest style from this tutorial as a starting point, and see how far I can get completely procedurally.

The distribution of trees in the forest is pretty simple. I take a Poisson point distribution, drop a circle at each point, and take this as a first step.

The actual shape of trees is going to be more irregular than just circles, of course. First, the general shape shouldn't be a circle, but more of an egg shape. I can alter a parameter and get shapes of greater or lesser egginess.

Next, to create lobes, I'm going to make the tree silhouettes the overlap of a bunch of circles. First, I put a Poisson point distribution inside the general tree shape. Second, I put a circle around each point, then take their outside boundary as my tree boundary. (I'm not drawing all of the circles here, only the ones that actually contribute to the boundary.)

Replacing the circles in the forest with these shapes already greatly improves the forest.

2. ## Forests part 2 -- shading the trees

If you look back at the tutorial I'm cribbing from, you'll notice that the shading on the trees is an integral part of the overall effect. In this post, I'm talking about getting a similar effect.

First, I tried a sort of drop-shadow effect. (Actually, the outline is stroked with a rotated elliptical nib, but the result is pretty much the same.) I don't really like it -- it looks too uniform. In the second test, I tried a different tack.

I went back to the circles that create the outline. I want to locate the circles on the bottom left of the tree, so I shift the general tree shape (red) up and to the right; the circles whose centers are in the shifted shape (black) form the "lit" section, while the other circles (blue) are the "shaded" section.

We can shade the trees in the forest scene and see that it's much improved.

Another nice factor in the original tutorial is the "ground", which is hatch-shaded. I can create a similar effect with straight lines deformed a little bit by random control point rotations.

Of course, one of the nice things about procedural generation is that I can generate this pattern at any scale and size.

3. Great stuff!

Will you be working on tree trunks in the next bit?

I'm amazed, with depth of your observation as to the shape and underlying form etc, you should be able to draw with ease.

4. Ya, they want trunks ... and that would make it a home run!

5. ## By popular demand: trunks!

Thanks for your comments! Trunks should be pretty easy; I don't think they need any kind of wiggliness (though it wouldn't be too hard to add):

And you're right; it improves the look considerably. Great!

On a related note: does anyone have any suggestions for software for converting from vector (in this case, PDF) to raster images? I'm using ImageMagick here (which farms it out to Ghostscript, I think), and while it looks fine on coarser images, it does terribly on the finer detail (like the hatching); those images I've had to convert manually in Illustrator.

6. Home run! Maybe ...

Can you feed a shape into your procedure, and generate complete trees within that shape? I mean, so the trees on the edges don't get cropped.

What software are you using to generate trees with your procedure?

7. Oh, ImageMagic, sorry, didn't read your whole post. (I *rock* at that).

(edit) ... Oh no, wait, did you mean you were rasterizing with ImageMagick?

8. Originally Posted by gilgamec
any suggestions for software for converting from vector (in this case, PDF) to raster images
Of course, Photoshop will rasterize vectors and PDFs. (Remember that a PDF is just a containter for vectors and/or rasters of any resolution(s) and/or type.)

9. Can you add a chance of a dead tree or stump being generated into the product? Also random generation of a glade or underbrush could add to the end product.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•