   Set me straight on verlet integration/constraints/Jakobsen
  Hi all,I recently started looking for a nice way to do some very basic cloth simulation for things like scarfs and belts on characters. I came across verlet integration in the process. I have a nice demo set up after following [1] where I can move a sphere around and have it interact with a hanging sheet of cloth, which is fun :)However, I still have some lingering questions.1. As you'll see in the screenshots [2], I have two constraints to hold the top corners of the sheet in a fixed position. After a while, gravity seems to stretch the sheet out around these points. Is there any way to work around this? I'm happy to provide more details and code, but perhaps it's a common problem?2. Am I correct in thinking that the constraints system used in [1] has nothing what-so-ever to do with verlet integration? It just so happens that verlet copes well with the constraints changing the positions and so you often see these two systems bundled together. With another explicit integrator, such as explicit Euler, you'd have to have the constraints adjust velocity too, I guess?3. Am I correct in thinking that the constraints system isn't based in any kind of physical reality? It's just a really cool hack that produces something convincing after a bunch of iterations, the number of which is determined by trial and error. If I understand what it's doing correctly, then a big enough number of relaxations per time step would make my cloth behave more like a block of rubber or plank of wood. So the speed and general effect produced make it often applicable for games, but it would be inappropriate for a simulation in a stricter sense of the word.4. What is the mathematics behind the constraints relaxation? It looks like it might be performing some kind of linear optimization implicitly, but I would like to know the gory details; under what conditions will this constraints system fall apart? Do the constraints have to be linear, and if so, in what sense? (is |x0-x1|=L a linear constraint for vectors x0 and x1?). One of the references mentioned Lemke's algorithm, but it's not entirely trivial to fit some of the cloth constraints in to canonical form. Any insights at all are appreciated, but those backed up by maths more so, eigentellyou [3].Thanks,Edd[1] Advanced Character Physics by Thomas Jakobsen.[2] Screenshots of my simple cloth "simulation".[3] Sorry.   