This software provides a 3D real time rendering of a garden, where put trees or bushes. It is based on Lindenmayer System, that consists of an alphabet simbols with some production rules. Algorithm starts with an axiom and expands rules iterations-times. The generated strings are converted into geometric structures, branches in our case. The tree generated has a fractal branch scheme.
It was written in Javascript with Three.js framework, which is based on WebGL API.
Download code and run index.html
with a browser. In Chrome local mode, make sure to turn on the
-allow-file-access-from-files
flag or run it with local server (best solution) to load textures.
It is recommended to have dedicated GPU to render more trees. Code tested with Firefox and Chrome.
In this demo, you can:
- Choose a ground point with mouse click;
- Select the complete tree Grammar, in particular the axiom and two production rules.
- Complete tree parameters, like branch length, branch radius, branch angle and so on.
- Choose some fancy tree features, like season and different textures.
- Render with the button.
- Eventually, you can use 5 preset different type trees.
[1] Przemyslaw Prusinkiewicz and Aristid Lindenmayer, The Algorithmic Beauty of Plants, 2004.