Ageia paper on position based physics

 Posts: 875
 Joined: Sun Jul 03, 2005 4:06 pm
 Location: Kirkland, WA

 Posts: 24
 Joined: Sat Aug 06, 2005 7:48 am
 Contact:
Nice demos! Motion looks very good.clanzotti wrote:Well, as already mentioned i used this method years ago. I've published no papers about it for some reasons.John Schultz wrote:Regarding section 7 of the paper, Future Work and rigid bodies:
[snip]
What I like about this method is it's based on constrained particle physics as opposed to optimization methods, which IMO looks much more realistic, and so far runs fast (have not spent any time optimizing the final system yet). Since it's possible to switch between a tetrahedralparticle based integrator and rigidbody momentumbased integrator, one can validate motion for accuracy (rigidbodies being a simplification/averaging approximation to particle systems).
John
The anims below where all made using a method similar to the proposed 'position based physic' (Circa 2003) :
Looking at the videos, it appears you are using somewhat complicated point mass networks for the rigid bodies. My system only uses 4 particles per RB (tetrahedrons), and uses the tetrahedral barycentric basis to provide realistic physical repositioning of the RB's without iterating the deformed tetrahedrons (see Jakobsen's paper for the barycentric tetrahedral projection concepts). The integrator is still a rigidbody momentumbased integrator (hybrid RK4like; not a Verlet particle integrator). The particle system is only used for repositioning (and slight momentum change). The trick to making this work is computing the total kinetic energy of the interacting particles before projection, then distorting the tetrahedrons via (effectively weighted) projection, then correcting the total kinetic energy (moving the tetrahedrons causes a kinetic energy change (Verlet particles)).
A cool result of not iterating is that stacked objects are very rigid, with no springiness (no special sorting or ordering is required). Also note that when shooting the base box(es), the entire stack rotates nicely and realistically (impulsebased nonordered, nonweighted sequential friction). The best way to test in the demo is to use a joystick, put the car into hover mode (the car flies+hovers), hover at the height of the smaller boxes, then shoot the single box stack (will auto reset after a few seconds).
Hi John,
The system can use any solver (Actually it come with Euler, RK2, RK4, Implicit Euler and the Velocity Verlet).
Anyway, while it can be good in some particular scenarios, this method still lack of a good friction model and a 'panicfree' rebouncing collisions.
I've been working on it for years, testing the pro and cons, so, if appreciated, i will post more test animations and technical details about it.
BTW: I saw your demo time ago and it looks very cool too!
Regards,
Carlo Lanzotti
Yes, my system uses a complicated pointmasses connections generated automatically based on the user needs. The connections can be of any types (E.g. PointPoint, PointEdge, EdgeEdge, PointTriangle).John Schultz wrote:clanzotti wrote:John Schultz wrote:
[snip]
Nice demos! Motion looks very good.
Looking at the videos, it appears you are using somewhat complicated point mass networks for the rigid bodies. My system only uses 4 particles per RB (tetrahedrons), and uses the tetrahedral barycentric basis to provide realistic physical repositioning of the RB's without iterating the deformed tetrahedrons (see Jakobsen's paper for the barycentric tetrahedral projection concepts). The integrator is still a rigidbody momentumbased integrator (hybrid RK4like; not a Verlet particle integrator). The particle system is only used for repositioning (and slight momentum change). The trick to making this work is computing the total kinetic energy of the interacting particles before projection, then distorting the tetrahedrons via (effectively weighted) projection, then correcting the total kinetic energy (moving the tetrahedrons causes a kinetic energy change (Verlet particles)).
A cool result of not iterating is that stacked objects are very rigid, with no springiness (no special sorting or ordering is required). Also note that when shooting the base box(es), the entire stack rotates nicely and realistically (impulsebased nonordered, nonweighted sequential friction). The best way to test in the demo is to use a joystick, put the car into hover mode (the car flies+hovers), hover at the height of the smaller boxes, then shoot the single box stack (will auto reset after a few seconds).
The system can use any solver (Actually it come with Euler, RK2, RK4, Implicit Euler and the Velocity Verlet).
Anyway, while it can be good in some particular scenarios, this method still lack of a good friction model and a 'panicfree' rebouncing collisions.
I've been working on it for years, testing the pro and cons, so, if appreciated, i will post more test animations and technical details about it.
BTW: I saw your demo time ago and it looks very cool too!
Regards,
Carlo Lanzotti

 Posts: 875
 Joined: Sun Jul 03, 2005 4:06 pm
 Location: Kirkland, WA
I would appreciate this very much .I've been working on it for years, testing the pro and cons, so, if appreciated, i will post more test animations and technical details about it.
I also have one particular question. How do I make the suggested method also independent from the timestep? The paper says how to make it independent from the iteration count, but I find it also interessting to decouple it from the timestep. Take for example a pointpoint constraint in Bullet. I think we use something like this:
v = tau * dx/dt + damping * dv
v := Velocity error we want to correct
dx:= Position error (e.g. due to drift)
dv:= Relative velocity at the anchor
How do I need to choose tau (Baumgart term) and damping to make the system independent from the timestep?
Cheers,
Dirk
Nice Paprer and interesting thread,
great movies by clanzotti to.
I am not integrating some ideas of this paper in my system, but there is one problem with collision it is not always stable.
What is the best way to make collision stablel and without artifacts?
The dependence on timestep is not as important but of course it would be nice to make it independent.
Can the method used to decouple from iteration count uset for timestep too?
Cheers,
DevO
great movies by clanzotti to.
I am not integrating some ideas of this paper in my system, but there is one problem with collision it is not always stable.
What is the best way to make collision stablel and without artifacts?
The dependence on timestep is not as important but of course it would be nice to make it independent.
Can the method used to decouple from iteration count uset for timestep too?
Cheers,
DevO

 Posts: 111
 Joined: Fri Sep 08, 2006 1:26 pm
 Location: Germany
 Contact:
If you have a ball (1kg) falling down without any constraint. After one second it has the velocity 9.81m/s. And the position changed by 9.81 m, if you use this discretization. But in reality it should have changed by 4.905 m.This is what you have to solve. Several strategies exist here, e.g. for rigid bodies we use the following discretization:
x(t + dt) = x(t) + v(t + dt) * dt
v(t + dt) = v(t) + W * (f_ext  JT * lambda) * dt
and use the (hidden) velocity constraints with Baumgarte stabilization.
Jan

 Posts: 875
 Joined: Sun Jul 03, 2005 4:06 pm
 Location: Kirkland, WA
This is indeed correct for a ball, but we don't use this formulation in order to simulate balls in free fall and I don't think that this detail is important for the quality of the simulation. But as I said considering objects under free fall and using something like
x(t + dt) = x(t) + v(dt) + 0.5 * a(t) * dt^2
might be a very reasonable assumption. What I wanted to point out is that the described method (as also stated in paper) is more some kind of timestepping method where the derivates are approximated by a first order accurate forward difference. I wonder if it would make sense to use second order accurate central difference, ideas?
Cheers,
Dirk
x(t + dt) = x(t) + v(dt) + 0.5 * a(t) * dt^2
might be a very reasonable assumption. What I wanted to point out is that the described method (as also stated in paper) is more some kind of timestepping method where the derivates are approximated by a first order accurate forward difference. I wonder if it would make sense to use second order accurate central difference, ideas?
Cheers,
Dirk

 Posts: 875
 Joined: Sun Jul 03, 2005 4:06 pm
 Location: Kirkland, WA
Think of a character running with a cloth cape attached. If you apply global damping you damp away the velocity of the running character. The method proposed in the paper (which works actually quite good) only damps the velocity relative to the centroid of the particle system, so it maintains the "running" velocity.
The paper gives pretty good explanation on how to compute the matrices for this method. Maybe you give it another look...
The paper gives pretty good explanation on how to compute the matrices for this method. Maybe you give it another look...
a tilde ~ over a vector means to use the "cross product matrix", see for example http://en.wikipedia.org/wiki/Cross_prod ... iplication (they use a subscript x to indicate the same thing)

 Posts: 135
 Joined: Wed Jul 27, 2005 10:28 am
 Location: SCEE London
the method proposed in the paper allows to decouple the velocity due to deformation from the velocity due to the rigid body motion so that you can have separate amounts of dampings. For example if you are trying to simulate a highly damped spongy material this would result in very high air friction without the proposed method. So by employing the method of the paper, you can have the material damping and the rigid motion damping by decoupling the respective velocity components.Dirk Gregorius wrote:The method proposed in the paper (which works actually quite good) only damps the velocity relative to the centroid of the particle system, so it maintains the "running" velocity.
so for a each vertex you can have : material damping, rigid linear damping and rigid rotational damping.
A similar problem happens with FEM, if you add damping by using a diagonal damping matrix like proposed in many papers, you cannot damp the material without increasing air friction. So the full corotated damping matrix should be computed instead.
cheers,
Antonio
Sorry if this is a noob question, as I'm not really a physics noob, plus it relates to this thread, but ...Erwin Coumans wrote:Being able to handle distance, planar and volume preservation in a stable way allows you to do very good quality deformable objects. So it might very well be a fast and stable alternative to FEM. People used verlet for years now in cloth and rigidbody context, and this new paper describes a more general application. Volume preservation, bending etc fit in the same framework.
When trying to enforce an area (triangle) or volume (tetrahedron) constraint, there seems to me to be two ways to go about it:
1) A "pressure" based model, where forces are applied (in the area/triangle case) perpendicularly to the edge and proportionally to the length of the edge, or (in the volume/tetrahedron case) perpendicularly to the face and proportionally to the size of the face.
or
2) Applying forces from the CoG of each edge through the CoG of the whole triangle (or in the volume case, from the CoG of each face through the CoG of the whole tetrahedron).
Unless my math is wrong, both methods will preserve the overall CoG and orientation of the object, so that's not an issue. #1 seems more physically correct to me, but it will tend to affect the shape of the object (e.g. if the area of a triangle needs to be expanded, it will tend to move towards an equilateral triangle assuming no distance constraints are applied on the edges). And the math seems easier with #2. So my question is: which method do you use, or is there some other method that hasn't occurred to me?

 Posts: 875
 Joined: Sun Jul 03, 2005 4:06 pm
 Location: Kirkland, WA
I would use area and volume preserving constraints. You don't want to use forces, because this will make the simulation unstable:
Area preserving constraint (triangle):
C =  (p2  p1) x (p3  p1)  / 2  A0
Volume preserving constraint (volume):
C =  (p2  p1) * [ (p3  p1) x (p4  p1) ]  / 6  V0
You can then use the same algorithm like in the paper. You basically relax distance (edges), area (triangles) and volumes (tetrahedras) constraints. All the projections will conserve momentum.
Cheers,
Dirk
Area preserving constraint (triangle):
C =  (p2  p1) x (p3  p1)  / 2  A0
Volume preserving constraint (volume):
C =  (p2  p1) * [ (p3  p1) x (p4  p1) ]  / 6  V0
You can then use the same algorithm like in the paper. You basically relax distance (edges), area (triangles) and volumes (tetrahedras) constraints. All the projections will conserve momentum.
Cheers,
Dirk

 Posts: 135
 Joined: Wed Jul 27, 2005 10:28 am
 Location: SCEE London
by pressure based model is usually meant a model where you only have the deformable body surface and the internal volume is preserved by adding a pressure model. So it's like a surface filled with gas and thats exactly like it will behave. It doesn't look realistic/solid enough.bone wrote:1) A "pressure" based model, where forces are applied (in the area/triangle case) perpendicularly to the edge and proportionally to the length of the edge, or (in the volume/tetrahedron case)
regarding volume preservation in general various methods have been proposed and are used: FEM, shape matching, position based and many others... the best method to use depends on the desired accuracy, speed, memory requirements, convergence properties, what you want to model and in which context. As usual the more you know the better:)
cheers,
Antonio

 Posts: 135
 Joined: Wed Jul 27, 2005 10:28 am
 Location: SCEE London
thats a good option, however if for example we want to parametrize realistic materials in terms of poisson ratio and young modulus that way of preserving the volume wouldn't do it. There is also some coupling between the edge preservation constraints and the volume preservation constraints. So it maybe a good choice for many cases but i would not exclude the other options.Dirk Gregorius wrote:I would use area and volume preserving constraints. You don't want to use forces, because this will make the simulation unstable:
Area preserving constraint (triangle):
C =  (p2  p1) x (p3  p1)  / 2  A0
Volume preserving constraint (volume):
C =  (p2  p1) * [ (p3  p1) x (p4  p1) ]  / 6  V0
You can then use the same algorithm like in the paper. You basically relax distance (edges), area (triangles) and volumes (tetrahedras) constraints. All the projections will conserve momentum.
Cheers,
Dirk
Regarding the position based approach as it's using a gaussseidel approach at the top level it would be interesting to compare its convergence with a preconditioned block sparse CG solver typically used for FEM. Especially when all the materials aren't very soft. We may have cases when materials with different properties make up a soft body.For example: skin layer, fat layer, muscle layer, bones.
cheers,
Antonio