nardove

Icon

ricardo sanchez | interactive designer & code enthusiast

SWIMMING JELLIES

3D jellyfish swimming simulation build with Processing and Toxi library.  This personal project had a long run, it started back in late-2009 when I was looking for a 3D sketch to work on so I can learn some 3D basics. From there I found my first 3D problem to solve, how do I draw a hemisphere? Few months later and I manage to finish a pretty good looking jellyfish, working together with Cedric Kiefer. It end up being a nicely detail digital organism, you can read about it here.

Since the initial idea I wanted to simulate their motion, I always found them fascinating to look at. So I took what I learn from the jellyfish and change a couple of things, the major change was the adoption of the toxi library, it has a very good set of math and physic elements that work together seamlessly, which help me to over come most if no all of the 3D motion, calculations and formulas I needed to achieve the main goal.

I had a jellyfish already, so the next step was to make them navigate in the 3D space, for that I went back to the steering behaviors code from the koi fish pond, and add the extra dimension “Z”. Adding the Z was easy but once that was in place I encounter another bigger(at least for me) problem, 3D orientation and rotation. I spend lots of time in the forums and books, and I did ask lots of question, I think I upset some people in the process, but they all help and the orientation got implemented.

Hope you like it.

View sketch

 

Following is a summary of the work involve.

 

3D Steering Behaviours. Using the wander behaviour they did move very smooth, there was some flicker and flipping going on but I didn’t notice it, as I was using the appear-the-opposite-side wrapping method. That changed later.

View

 

I add a verlet spring chain to the agents, at this point I was still struggling with the rotations but I did fix the wrapping. I had to make them avoid the walls otherwise they will disappear in the background and looking very crappy specially the tail. But there was another problem the wander behavior makes them to conglomerate to the bottom right of the room, not good.

View

 

Most of the problems where solve at this point, orientation, wall avoidance, I also change the wander behaviour to flocking because the randomness of the wander was giving problems with my orientation implementation. And more chains added to the agents. The jelly was evolving very nicely.

View

 

Finally I got what I was looking for. The jellies were swimming freely in the environment with no major hiccups.

View

 

Then I just had to design the textures and environments, I love this stage of the process as much I love the coding.
Jim (jimrxn) help me by doing the html page, the implementation was a breeze plug-and-play.

View

Category: Processing

Tagged:

Leave a Reply