TREEMAKER
is a graphics program that generates random pictures of trees.
After
thinking about it for a while, I decided that a simple recursive routine
was all I needed to make a tree shape. When you think about it, each branch
is just a line with some other lines coming off of it. Those lines ("child"
branches) are in turn, exactly the same thing- another line with more lines
coming off of it.
"Treecursion"
Make A Tree
How long should it keep branching?
Child Branches
Min:
Max:
Children branches are this much thinner
Min:
Max:
Children branches are this much shorter
Min:
Max:
Max. degrees (left or right) children can branch
(The pre-entered values are for
an oak-like tree.)
How To Use It
Simply
enter numbers in the fields and click "Draw It!" to see the results. The
graphic will be based on random numbers restricted by the values you entered.
Hit "Reload" to get a slightly different tree for the values you typed
in!
"How
long should it keep branching?"
The
"end" of a branch is determined by three things- if the children would
be of 0 thickness, if the children would be of 0 length, or if the tree
has branched as far as you'll let it (this ensures we never branch "forever"
because the branches aren't getting any thinner or shorter).
See
"...thinner" and "...shorter" below.
"Child
Branches"
This
determines how many times one branch can split (fork). If you entered "1"
for the min. and max., you'd get a wriggley, branchless stick. If you entered
really high numbers, you'd get something like broccoli.
"Children
branches are this much thinner"
If
you want your tree to get thin very quickly, enter high numbers. If you
want it to get thin very slowly, enter low numbers.
"Children
branches are this much shorter"
This
is similar for "...thinner" above, but these values control how much shorter
"child" branches are compared to their "parents."
"Max.
degrees (left or right) children can branch"
If
you enter a low number, the tree will remain tall. If you enter a number
above about 50, you'll get windy trees that may even end up branching underground
(where you can't see them)!
NOTE:
Some values will cause Treemaker to crash and you won't get an image. Not
to worry! Just try some lower, "safer" numbers.