My final piece for Golan Levin’s Interactive Art & Computational Design course was an interactive installation wherein the viewer is transformed into a tree while standing in front of the piece with arms raised. The body forms the trunk, and the arms form large boughs, as branches sprout from the viewer and eventually grow blossoms at their tips. Built using openFrameworks, the piece uses OpenNI to detect the viewer’s pose and place branches along the torso and arms.
Get the code on github.
The tree branches are simply stored in a binary tree (see what I did there?) structure; each node contains a length and angle. Drawing the branches is then simply a matter of traversing the binary tree in a depth-first manner and, at each node, applying a translation and rotation to the canvas before drawing. I used ofxOpenNI to set up the kinect and detect the user’s skeleton. I attached branches to various limbs on the skeleton such as the shoulder, humerus, and head. The entire branch structure is generated when the user is detected by OpenNI, and growth is simulated by progressively drawing deeper in the tree structure. Once a limb has reached its terminus, blossoms are added progressively to the end of the limb.