Week 4

We’ve arrived at the moment of truth; particle systems. Simply put, particle systems are a collection of objects that all operate on a similar rule-set. But they have a wide range of possible uses; by tweaking their variables or dressing them up, they can model behaviors like flocking birds, clouds, or fire.

Particle Emitter

This is a simple example of a particle emitter using additive blending. Dragging your finger sends a wind force toward the emitter. I’ve also included a settings panel that allows you to select any of the OpenGL blend functions.

Burning Paper

In this example, I’ve created a “Flame” subclass of ParticleSystem. You can spawn flames by touching the screen, and they seek out the brightest regions of the paper. They will avoid their own trails, since they’re black, and the flame burns “upwards” according to the device orientation.

Both of these sketches have been committed to my Nature Of Code github repo.

February 27, 2013 Nature of Code

Week 3

This week’s installment of Nature of Code looks at oscillation and springs. As always, the code is available in my NOC github repo.

Waves in 2D

Waves in 3D

February 18, 2013 Nature of Code

Today I wrote a quick app for my phone that changes the screen color when it detects a sudden change in motion. Here are a few long-exposure photos I took of me waving it around in a dark room.

December 26, 2012 Leisure