I’ve spent the last few weeks working with the Kinect to do some 3D skeleton tracking for an upcoming project. After recording the 3D positions of various body parts using the Kinect, I use the data to create a 3D shape, with its size and structure determined by the positions and movements recorded.
Here are some images and videos of work in progress.
L-System, or Lindenmayer System, is a mathematical formalism originally developed by the biologist Aristid Lindenmayer to describe the growth of simple multicellular organisms. While Lindenmayer initially studied algae and fungi, the L-System was eventually applied to plants and other more complicated structures.
L-Systems can also be used to generate fractal patterns. While I had done something very similar in earlier studies of branching patterns, this time around I actually wanted to see the pattern being drawn. As such, I had to create a simple turtle object that takes the position, angle, and length as the initial parameters and draws a line accordingly.
From there, it was just a matter of creating an iterative structure in the software and setting the rules as to when branches should form, at what angle, and what size. Of course, when writing iterative programs, it’s important to set a breakpoint so that it stops at some point, and doesn’t continue indefinitely. In my studies, I set it so that if the length of a branch is less than 10 pixels in length, it no longer reproduces.
Below are a few images generated by the program:
Videos showing fractals being drawn using the L-System:
After using the chaos game to generate the sierpinski triangle in the last post, I wanted to see if the same iterative process worked in 3D to create the Sierpinski Tetrahedron (aka Tetrix) seen below:
As it turns out, the iterative process is exactly the same, except instead of 3 markers, you now use 4 markers, each positioned at one of the vertices of a tetrahedron. Here’s a video of the fractal being drawn:
Created a sphereflake, which is a 3D version of the Koch snowflake, using spheres. It was originally developed by Eric Haines.
As I could only find photographs of the sphereflake, but not descriptions of the actual iteration, I had to do some trial and error to place the next-level iterated spheres in the right locations. I’m still not sure if this is the exact same one as Haines developed, but it looks pretty close.
There are nine spheres created in each iteration. Six of them are placed 10 degrees below the equator of the orignal sphere, spaced 60 degrees apart from one another. The other three are positioned by finding the midpoint between two of these six spheres, for every other sphere, and then moving upwards 60 degrees. It’s probably a lot clearer to just look at the code.
I have been studying branching effects lately. Below is a screenshot of an example I wrote in Cinder. It was primarily an exercise in testing the concept and getting the algorithm right.
Playing around with different combinations of sine and cosine functions in Cinder. Here are some of the more interesting ones: