The objective of this project was to create a simple model of an L-System based on the work by Aristid Lindenmayer using C++ with the Octet framework to generate trees. My main objective was to write a code that could generate a tree as real as possible, not knowing what kind of tree will be generated and always different in each cycle; the way to do this, was using probabilities in every parameter possible. An obstacle faced trying to achieved this was to keep the generated tree looking like a real tree, this means, draw a tree as random as possible but keeping the basics look of a tree. The name of the project is Tree of Life.
The project consist in nine files (*.txt) within the program, eight files with different trees to draw and one configuration file, the user has to decided which to load or edit through the command line (user interface). The algorithm starts loading the configuration file and the axiom and rules from file that the user select, then it draw the tree using cylinders meshes without physics one cycle at a time.
The rotation of the branch; represented by the characters + and – in the algorithm. With the objective of generate a tree as real as possible, when these characters are read from the axiom, the algorithm divide the large of the branch and the angle of rotation by 7 and draw seven cylinders in sequence, generating a curve branch. The angle of rotation can be a value fixed by the user or a random value between 2 and 5, considering that the curve is composed by seven cylinders, that makes a total angle of rotation between 14 and 35 degrees.