buoyancy

Another piece of code stuck in a drawer. Orig­i­nally it was meant to be an exer­cise in col­li­sion detec­tion between falling par­ti­cles. Fake physics, shud­der. To make the inter­ac­tions inter­est­ing the par­ti­cles need to move at dif­fer­ent speeds, oth­er­wise they would just get stuck together. But the move­ment never felt right. Fool­ing around, I reversed the ver­ti­cal motion and some­how it works… I’d like to claim it was a con­scious deci­sion, but it wasn’t.

It’s amaz­ing how the col­li­sions sug­gest rota­tion. Try to fol­low a small bub­ble when it hits a larger one, can you see the larger bub­ble rotat­ing? The inter­ac­tions involved are decep­tively sim­ple, the bub­bles move slightly apart when over­lap­ping. Noth­ing else. Actu­ally, the hard­est part was find­ing a name (and spelling it): buoy­ancy (click here for a ver­sion with­out OpenGL). Mov­ing the mouse pops the bubbles.

buoyancy

Leave a Reply