Overview
This is a p5.js sketch inspired by the Coding Train’s Coding Challenge #17 on implementing the ‘Space Colonization’ tree growth algorithm, as outlined on AlgorithmBotany.com.
The gist of it is to imagine the end result of a tree’s growth, in terms of location of the leaves … and allow the branches to grow into those spaces.
This was intended to mimic how roots would grow (and compete) over nutrients in the soil. In reality, plants roots don’t detect nutrients and so they don’t grow toward them.
From CropNutrition.com
Since roots have no special radar, sonar or other device to detect nutrients around the corner or in deeper soil layers, they instead depend on, essentially, the nutrients coming to them.
Some plants do exhibit Hydrotropism in root growth, meaning they grow towards more humid areas.
Controls
Keyboard:
p
Will save a screenshot to your downloads folder.
References:
- AlgorithmBotany.com - Space Colonization
- p5.js -
saveCanvas()
Allows saving a screenshot of current state. - CropNutrition.com - How Plants Absorb Nutrients
- Wikipedia - Hydrotropism