=========================================
MakeTree 1.0
=========================================
Leaf & Tree macro for Pov-ray 3.1 & higher
(c) 1999 Gilles Tran tran@inapg.inra.fr
=========================================
The Maketree macro can create imaginary trees that look 
more or less realistic. The algorithm used here is
totally empirical and is based on self-similarity.
It cannot create cone-like trees such as pine trees.
Beware that large recursion levels (>6) can lead to
large parsing times.

- Leaves are turned on by setting the [leafproba] parameter > 0->1
  leafproba=0 : no leaves
- Roots are turned on by setting the [rootproba] parameter > 0->1
  rootproba=0 : no roots
- Trunk twigs are turned on by setting the [twigproba] parameter > 0->1
  twigproba=0 : no roots
- Gravity, antigravity or wind are turned on by the [vpush] vector.
  vpush=-y : gravity
- Gnarledness is turned on by setting the [fgnarl] value > 0
  fngnarl=0 : no gnarledness
- The [dotexture] flag (true/false) applies the txtTree texture to the
branch and root segments according to their position (see below)
  * If dotexture=true, then the tree include file contains already
  the call for the tree texture and the texture is positionned
  according to its position in the tree. This allows for more
  realistic texturing but can be expensive memorywise.
  * If dotexture=false then you will need to apply it afterwards on the 
    whole tree.

- You will need to define two textures, one for the leaf (txtLeaf)
and one for the tree bark (txtTree)
How the texture is applied depends on the choice of the [dotexture] 
parameter during the tree generation
The leaf texture is applied on the whole foliage
(though you can add it manually in the leaf include file
if you want to have leaves individually textured).
Texture examples in the txttree.inc file.

- In the examples, the leaves are created by the MakeLeaf macro,
  but you can import your own leaf object, provided it's called "Leaf".
  It should be positionned on <0,0,0> and point between -z and -y.

Look at the end of the maketree.pov file or in the extree*.pov files
for other parameter definitions.

=========================================
Maketree.pov : 
This file contains 4 macros to build trees
MakeTree : "wrapper" macro for the MakeBranch macro
MakeBranch : recursive macro that creates a tree structure
MakeRoot : recursive macro that creates a 2-level root branch
MakeLeaf : creates different kinds of leaves
and 2 vector utilities : vCone and mAlign
-----------------------------------------
Extree*.pov
Working examples of the Maketree macro. Just run them.
If the parsing & tracing time is too high
lower the recursion level [level0 parameter]
-----------------------------------------
Showtree.pov
Template showing how to load the *.inc files
First run one of the extree*.pov files with [dofile=true]
Put the right file names and textures in showtree.pov
Run showtree
-----------------------------------------
txttree.inc
Some tree textures and leaf textures used in the extree*.pov files

=========================================
How to use the macro
There are 2 ways to use the macro.
1. Use one of the extree*.pov files as template	
   and paste it within your scene
   Set the [dofile] parameter to false and the other parameter as
   you wish.
   The tree(s) will be created "on the fly"
2. Use one of the extree*.pov files as template
   but set the [dofile] parameter to true
   Run the file. It will show the tree and create 3 files :
   a leaf mesh include file, a tree (branch & root) include file
   and a foliage include file
   Then use the showtree.pov file as a template
   to load the *.inc files created above
=========================================
Credits go to :
- Daniel Skarda for providing the first algorithm I used
  for tree recursivity
- Margus Ramst for ideas taken from his worm.inc & fur.inc macro
- Steve Pidgeon for parameter ideas from his arbre.inc macro
- Ken Tyler for adding leaves in the previous version of this macro
- John VanSickle for his tutorials on vector calculations

-----------------------------------------
Note on texturing
-----------------------------------------
-----------------------------------------
