My creative process is very sculptural. Seeing as how I graduated with a degree in sculpture, this is no surprise. When I code, I keep adding and adding and adding until I reach a point where I start to get confused. Then I step back and look at the piece from all angles until I see some direction I would like to explore. Then I do a little clean up to eliminate the parts that don’t belong in the new direction, and then its back to adding.
With this in mind, I have revisited the first source release. I have chosen not to release something entirely different, instead opting to build on the foundation that the first source provided. I think it might be useful for people to see that I generally don’t build towards a specific goal. I just wander. Sometimes I wander down dead ends, but sometimes I find myself in places that I hadn’t imagined could exist. Man, I need more coffee. These code-metaphors are starting to get a little cheese.
So here it is, release 2.

Same deal as before but with a few extra features. As before, you can toggle the perlin noise, gravity, floor plane, and particle trail. The gravity and floor are now on by default.
‘P’ will toggle a Perlin Noise influence to the Particle velocity.
‘G’ will add a gravity influence to the Particle velocity.
‘F’ will toggle on an invisible floor allowing the Particles to bounce.
‘T’ will toggle the rendering of a Particle trail.
In addition, you can also turn on a basic smoke emitter and save out image sequences.
‘N’ will toggle the smoke effect (nebula).
‘S’ will toggle the saving out of images, one per loop.
Some features of this piece of source code:
• Basic camera controls using Kristian Damkjer’s OCD library. Right click and drag will reorient the camera.
• Added basic smoke effects.
• Added fake-lighting textures on the floor plane.
• Some simple depth testing to allow the floor plane to occlude the additive blended bits. I will probably expand on this in the next release because I have received a lot of comments about this particular process.
• Particles can now split if they hit the floor with enough force.
• Loaded images are now in the Images class. Organizational change more than a functional one.
• Saves out image sequences when the ’s’ key is pressed. Hit ’s’ again to turn of feature.
I must warn you this source release is not optimized to be processor friendly. If you leave the trails and smoke off, it can do okay. However, since the particles can split into even more particles, if you slam the emitter into the floor while holding down the left mouse button, you will create a fountain of particles that will multiply when they hit the floor and the frame rate will drop.
I could have limited the max particles the piece can have at once, but instead I will leave it as is. Maybe someone like Simon (cough) will attempt another shader version.
This source was a bit more rushed than the last one so it is not as well commented. If you are starting here and find yourself confused, I would recommend checking out pt. 1 first.
UPDATE: This code doesn’t quite work with Processing 1.0. There will be some bindTexture errors. This post should help you resolve those errors until I can find the time to redo this source code properly.

Man.. This stuff is awesome! Thank you again!
Robert – thank you so much for sharing this!
You know, like you, I also consider myself to be a horrible teacher. I teach a web development class for local high schoolers. With this in mind, I knowingly go out of my way to compensate for my lack of teaching ability. Typically, this requires meticulous crafting of my lessons beforehand… Spending inordinate amounts of time researching possible questions.
I feel that you go through the same sort of trouble, because similarly, you feel that your offering reflects your talent.
You are doing the community an indispensable service. I think everyone reading can appreciate your efforts, which have in fact been more than anyone was expecting.
thanks!
thanks robert, beautiful as ever.
i was wondering where the link to download the magnetosphere itunes visualizer went to?
Thanks all. Enjoy!
James, I appreciate the kind words.
Jeswa, not sure… let me look into it.
Well done, very inspiring…KNOWLEDGE IS POWER !
FYI, if you want to make it easier for people to run the code without needing to first download the libraries, you can simply put the libraries’ JAR files in your sketch folder in a folder called “code”.
i agree with Mr Reas..It took me some time to figure out how to have all this running, as a non processing expert….
Trying to make me do all the work?? Okay, okay, fine. I will include the libraries with the next round.
Robert,
How long do you think you spent writing this?
im just curious, as an aspiring processing user
Greg, hard to say because some of those things took me a while to learn. But once you learn it, you can do it much quicker. So time spent actually typing it in and getting it to work, less than a day. Time invested in learning how to do what is featured in this source code release is more like months.
thx robert for releasing this stuff. simply amazing work!
this is enough to keep me experimenting with for a while… really appreciate it.
Hi… once again this is great.
Following your steps and learning few simple tricks in opengl, without ever releasing anything major, took me more than months
… so bravo !
About the ‘libraries thing’: I’m personally not sure that including the JAR files in the downloadable package is indispensable. I mean, for sure this is going to be easier to run, but in the end this is less transparent, and less useful to the people learning. Adding a lib to Processing has been made so simple that I don’t see why the JAR should be added. But it would certainly give a change to the servers hosting the libraries to survive
Robert,
thanks for sharing the code.
One minor comment. In the renderTrails method of the Particle class, I believe it is not needed to calculate perp2, because perp1 is already horizontal in the first cross product.
Vec3D perp1 = perp0.cross( new Vec3D( 0, 1, 0 ) ).normalize();
Vec3D perp2 = perp0.cross( perp1 ).normalize(); // this line is not needed
perp1 = perp0.cross( perp2 ).normalize(); // this line is not needed
See… this happens when you publish your code
Thanks again!
Ah yes, you are probably right. This is a remnant from pulling out extra code to make the source a little cleaner. Normally, I calculate perp1 as a cross between perp0 and the normal from the camera eye to the camera center. However, it wasnt necessary for this particular source bit because the camera model is different from the one I normally use. At least I think thats the case.
Thanks for the comment!
Robert your work is fantastic. I believe your pushing the boundaries of digital art. Hopefully you plan on releasing more of your source code to encourage the ever-growing processing community. If you ever need a graphical hand, just drop me an email.
PS. I imagine cellular automata would be an interesting thing to look into (particles that make basic decisions and such).
Wow, thanks for sharing, the patch looks beautiful! I’m just starting out using raw openGL in processing myself, so it’s great to see where the standard is
Keep up the good work! Also, I really enjoyed your flocking algorithm/birds piece – been working with the ole boids myself recently and it’s really fun.
thank you so much, this source will definitely help my education
Very nice. In fact to my standards it’s also well written.
I’ve got a question though.
Does anyone know why this and some other OPENGL sketches can’t be exported as a working applet? I’ve done some “remixing” to this sketch, and it would be nice to show the results, but it just doesn’t work as an applet.
I was wondering that myself. I was going to put up an applet version of the source so people could see what it could do before downloading, but I had no luck so I moved on.
does anyone knows if there is any other information about this subject in other languages?
Nice!
i love it 100%, but i understand it only 1%, lol
Hey, have you seen this?
http://scienceblogs.com/pontiff/2008/02/morpho_towers.php
It seems relevant to Robert’s work.
est il availible en Francais, my English not good
mm: the cool thing is, this isn’t cg.
Robert,
I just found out about your excellent work and Processing today.. great stuff!
one comment about setPosition() in Particle if I may, it’d be faster to use a circular buffer for that loc array eg.
loc[locNum%len].addSelf( vel );
locNum++;
instead of
for( int i=len-1; i>0; i– ){
loc[i].set( loc[i-1] );
}
loc[0].addSelf( vel );
the renderTrails loop could then look something like:
for ( int i=locNum; i
Hey Giles, email me and I will add your comment manually. I assume you dont want it cut off like that.
Awesome of you to share the code. Just like it’s awesome of Jared Tarbell to share his. Cheers!
Anyway, I’m not getting something in the particle bit
if ( !p.ISDEAD ){
pgl.bindTexture( images.particle );
p.exist();
} else { // sau o sterg
particles.set( i, particles.get( particles.size() – 1 ) );
particles.remove( particles.size() – 1 );
}
What are you donig with the particle set and get ? I mean, why are you doing it, and why isn’t p.remove() or particles.remove(i) enought ?
Thanks
So what is Vec3D exactly? What does it do?
i only found out about processing yesterday – thanks to your videos on vimeo… leading me to this page.
i had to try it out and it worked awesomely
very exciting stuff – i had to watch through a lot of your videos..
i work with motiongraphics in the more traditional way – mostly in adobe after effects – and this has really opened my eyes for different ways of doing stuff. i love the way it’s all so organic and analog at the same time as being so digital…. if that made sense..
lloking forward to more of your creations!
fred
The stuff is awesome, I want it so bad
However I am using window….
Can anyone tell me how make it work in window?
Thank you!!!!!
Mine won’t run……
when I press “Run” button , it say
“The method bindTexture(PImage) from the type PGraphicsOpenGL is not visible”
in “emitter.pde”…..
what do I have to do?
sorry, I forgot writing what Processing ver. I use.
it is 1.0.1