Verlet Box
Benjamin Schroeder
 
A simple box simulation using Verlet integration with constraints, as described in the first two parts of Jakobsen's Gamasutra article.

Try dragging the vertices around with your mouse. The mouse dragging is implemented using a constraint similar to the other ones used in the simulation instead of with custom mouse handling code.

The constraints are only iterated a small number of times during each time step, so things can jump out of place during a drag. As described in the article, the simulation technique corrects for this over time.

If the error is not corrected in a single time step, however, it shows up as velocity, due to the way Verlet integration works. This is strictly incorrect, but does add a bit of liveliness and often results in more or less believable motion.