Interactive art installation that allows participants to create their own trees with their movements, watch them grow, and view them on the Earth from space, as the camera flies around.
produced by: Harry Morley
When the participant is in the line of site of the Kinect, leaves are placed and previewed where the person is detected (for example, with their hands). The z position (depth) of the leaf is chosen randomly, so only the x and y coordinates correspond to the physical position in space. After a few seconds, branches are then grown upwards towards the leaves, generating a tree. The tree is then placed on the Earth, which is viewed from space (stars included!). When the maximum number of trees is reached, the oldest tree is removed to make way for a new tree - this is to not clutter the Earth or turn it into a green fuzzy ball.
Key words: trees, nature, ecology, body, community, environment, zen.
I wanted to create a peaceful installation that conjured up feelings of community, and the responsibility we have for our planet. I aimed for the personalisation of the trees to represent the impact every one of us has on the whole world.
After following a Processing tutorial by Dan Shiffman, I became interested in generating trees algorithmically. The Space Colonization approach seemed interesting, and I liked the idea of allowing the participant to draw their own leaves, and watch the branches grow, attracted by the leaves. I purposely kept the design of the trees simple and wireframe-like and simplified the Earth texture using the GIMP photo editor, to achieve an uncluttered, cartoony aesthetic.
The project was built using openFrameworks/C++ with the ofxKinect and ofxOpenCv addons.
I originally set out to use PoseNet + OSC to generate trees according to skeletal information, but this gave uninteresting results and was needlessly overcomplicating the project. It was far simpler and more fun to allow the participant to draw leaves by moving their hands or body parts, using the Kinect and Computer Vision to sense the person.
Porting the Space Colonization algorithm from Shiffman’s Processing code was a challenge, as it involved using pointers (since, for example, a branch needs to be aware of its parent branch). Though by the end of it, I had gained a better knowledge on memory management in C++.
Once the algorithm was implemented, running the tree generation part whilst showing the 3D world caused the frame rate to drastically drop below useable levels (~5fps). So, I researched threading in openFrameworks and implemented a threaded version of the tree generation algorithm. The growing of the branches occurs on a separate thread to the main drawing thread. This dramatically increases performance, and the camera and world are able to spin around smoothly whilst a tree is being generated.
After displaying the piece at the popup exhibition, I realised through watching other people interact with my installation, that it is hard to work out how to interact with the installation as I intended - this is because there is a short time window where leaves can be drawn, once the Kinect first detects movement. I had not made it very easy to understand, and there were no instructions. When I was near my installation and showed people how to use it, then it was fairly successful and people enjoyed it. Having said this, I did enjoy watching people interact with the installation indirectly - leaves were added and trees generated when people were unaware - perhaps they had their backs turned or were accidentally in the Kinect’s line of sight. I really liked the look of the Earth and stars, and the way the camera randomly flew around the Earth (according to Perlin noise values). It was also worth putting in the effort to fix the performance issues, as the program ran smoothly.
If developing further, I would like to make the interaction much simpler and maybe not as sensitive. Perhaps the leaf generation can happen over time, and then a tree be generated after interaction with a few people, rather than a tree for each person.
In the feedback for my project proposal, one person suggested having some kind of antagonist disrupt the peace. Though I ran out of time to develop the piece to this point, I think this would have enriched the concept and sent a more powerful message regarding ecology and caring for the environment
I borrowed some code for generating random points on a sphere (random tree positions on the Earth) from this article by Karthik Karanth: https://karthikkaranth.me/blog/generating-random-points-in-a-sphere/#better-choice-of-spherical-coordinates
openFrameworks threading reference: https://openframeworks.cc/documentation/utils/ofThread/
Workshops in Creative Coding Lab Assignments used as reference (thanks Theo as always, for the code snippets and inspiration):
- Week 12 ‘Webcam Piano’
- Week 16 'Kinect Grid'
- Week 20 'Goodbye Stephen Hawking'
Dan Shiffman - The Coding Train tutorial videos:
- Coding Challenge #17: Fractal Trees - Space Colonization. https://www.youtube.com/watch?v=kKT0v3qhIQY
- Coding Challenge #18: 3D Fractal Trees. www.youtube.com/watch?v=JcopTKXt8L8
Runions, A., Lane, B., Prusinkiewicz, P. ‘Modeling Trees with a Space Colonization Algorithm’ original paper: http://algorithmicbotany.org/papers/colonization.egwnp2007.html