Research is officially under-way! So first-up, i found this peice of work:-
This is a really cool application; it allows the user to fire cannon balls at two pieces of cloth, and the cloth simulation and collision response seem very good. The dude who created this piece referenced an article - Advanced Character Physics by Thomas Jakobsen - as what he based it on. So i thought what better place to start than this:
'Advanced Character Physics', by Thomas Jakobsen
What I Learned From This Article
This article introduced me to a wide range of different topics concerned with real-time simulation.
The first interesting thing it mentions about simulation for real-time use is accuracy is not the major concern - it is more about believability, speed of execution and stability. Ultimately, for real-time use, if the programmer can cobble together a fast and stable solution that still looks believable to a degree, this is more valuable than an immensely accurate simulation.
Verlet Integration
Verlet integration works by storing a particles position and last position. The concept of velocity is not really taken into account, although it is implicity defined for the last frame by (position - old position). Not explicitly defining a velocity for a particle means, you can 'pick-up' particles and place them somewhere, in an instant; their velocity is implicitly defined as a result of their movement and the simulation continues smoothly - this makes it very useful for collision handling.
Constraints
Particle positions can be constrained by 'springs'. A weak spring will gradually satisfy a constraint and a stiff spring will rapidly satisfy a constraint. An infinitely stiff spring can instantly satisfy a constraint (put a particle straight back where it should be).
An Iterative Approach to Satisfying Multiple Constraints
Satisfying multiple constraints can be a problem because satisfying one constraint can invalidate another. The article mentions a method whereby each constraint is satisfied individually, and this process is repeated a number of times per frame. This winds up giving a result that converges to satisfy all constrains simultaneously (Apparently! I can foresee situations where the constraints are continually invalidating each other?). Supposedly, more times you repeat, the better the result converges so the method becomes flexible in terms of simulation accuracy, which is very useful for optimisation. Additionally, the articles states that Verlet Integration maintains the simulations stability independently of how accurate the results are.
Approximating Square-Roots
When satisfying a constraint such as the distance between two particles, a square-root calculation must be done per frame to know the current distance between them. Put simply, square-roots are slow and expensive. So a good optimization is to approximate the result. A method to do this is touched on in the article called 1st order Taylor-expansion. This needs further reading to understand its implemtation.
How can this be applied to my project?
Cloth could be a grid of vertices, each represented by point-particles with constraints between adjacent particles modelled by springs. Constraints are solved iteratively therefore giving a simulation with flexible accuracy, optimisable for real-time.
What didn't i understand in this article / what else needs to be researched?
- Numerical integration - the article mentions other types, which would be worth looking into. Also i'd like to better understand the issues related with stability (what exactly makes a method stable or unstable? and why do the stability issues arrise?).
- The article mentions optimisation through use of an array of floats instead of a Vector3 representation - how does this work?
- Approximating square-roots. 1st order Taylor-Expansion - how does this work and how can it be implemented?
- Relaxation / Jacobi or Gauss-Seidel iteration - learn more about this iterative constraint handling and how it converges the results to satisfy multiple constraints.
No comments:
Post a Comment