It’s an old trick: generate a set of pre-blurred sprites and choose the right one to show (based on depth) to give the illusion of an expensive depth-of-field effect. Here it is in a Processing sketch:
Use the mouse over the applet to control it – left/right controls rotation, up/down controls focal point and a deft click of the left mouse button gives an extra little kick to the simulation.
Once again this is just quick code thrown together over a couple of hours. The particles are affected by a two different forces: One pushes them to be a fixed distance from the origin, causing them to align themselves on the surface of a sphere, while a second force moves moves each particle away from it’s neighbours to stop them from clumping together.
I stole the pre-blurred sprites from Mr Doob’s similar HTML5 sketch.. I hope he doesn’t mind! ;)