Nature of Code final: update

I restrained the scope of the final to focus on the coral behavior. I would love to someday add in the fish, and set the whole thing up to take user input from the Kinect so that the coral respond to movement. For now, they respond to button-press, which can easily be substituted out when I learn how to use OpenNI and Kinect.

A lot of this project involved me getting over various confusions I had about…dun dun dun…the nature of code. For example: If you create an object in setup, it is not a simple matter to change their properties later. If you create them in draw, of course they can be updated next draw cycle. But when you create something in setup, it is before the universe starts – so if during draw you change a property in your Object class, it doesn’t matter. You already created specific instances of the class and those still have their original properties. The change will only apply to NEW objects. Unless you carefully reference every specific instance of your object and say “Yes, THIS object needs a change”. I learned this in ICM, but when we started making systems of object arrays interacting with each other it got confusing again.

Another thing I struggled with is working with toxiclibs. It makes particle and spring systems simpler, absolutely! But then I spend an hour or more debugging before it occurs to me, “remember to add the spring to the physics after creating it”.

So I have a simple set of arrays for my coral and its polyps for now, placed in voronoi polygons which I really liked playing with. Most of the work done was in just understanding what I was doing, and I am ready to add more complex behaviors in the future.

Update 2:
So OpenNI and Kinect will have to wait for this summer…
In terms of the final sketch, I tried many many things, but have for now only a simple base to grow from.
I played with springs and forces and eventually created a particle system I feel resembles the gentle drift of small bits of food getting caught in a coral’s range, with the option to force a “jet” into the water and push bits away (and create new bits, since the previous ones may have floated off screen). This will really look great once I get a good flow set of splines for the coral’s tentacles to wave around. Which is right around the corner!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s