Plants in TPF can be defined in two ways :
In TPF both approaches can be used on one model. For example you can manually paint the tree trunk shape and a couple of main branches, then use procedural rules for hundreds of smaller branches which would be otherwise too numerous to paint. You can also interactively edit a purely procedural model, and using the mouse, change the shape of procedurally defined branches or paint to add some new branches to this model.
Fortunately most of branch shapes on a tree follow some rules:
- Branches growing from the trunk are almost always thinner than the trunk at the point where the branch grows. The branch angle to trunk also isn't random from 0 to 180 deg, but is in a narrower range, about 30-40 degrees, and branches growing at top of the trunk grow at a narrower angle.
- Some trees have their branches bending towards the ground, other species have branches which tend to point upwards or horizontally.
When creating a recipe for procedural plant creation, the user should find out what rules apply to the species he is trying to model, and then try to define those rules in the model.
To communicate plant creation rules to computer, we use a graph. Graphs for plant creation are pretty similar to ones used by the Function Editor for creation of materials.
When creating plants, mostly one type of node is used - the segment node. The Branch node will make up about 80-90% of all nodes used for plant creation. It is a very complex node, composed of about 100 parameters. Fortunately you don't have to define all those parameters, usually just about a dozen of parameters are defined for an average branch node at a time.