## Soft bodies early preview

Please don't post Bullet support questions here, use the above forums instead.
Antonio Martini
Posts: 135
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

### Re: Soft bodies early preview

Nathanael wrote: But even using gradient directions, volume inversion do happen
it happens but some methods seem numerically more robust and can recover gracefully, see section 3.4 of:

http://www.matthiasmueller.info/publica ... GI2004.pdf

cheers,
Antonio
Last edited by Antonio Martini on Sat Mar 22, 2008 4:20 pm, edited 3 times in total.

Nathanael
Posts: 78
Joined: Mon Nov 13, 2006 1:44 am

### Re: Soft bodies early preview

Antonio Martini wrote:However if you use only one rigid frame and move the vertices out from the object mass center it would not work well for many important cases. make a long straight cylinder and bend it in a U shape, the mass center is in the middle and it looks like that the intermediate "pulled" shapes would look very bad before the object, if we are lucky will go back to the original shape. have i missed something again?:)
No you didn't miss anything, but the problem can alleviated by using clusters of vertices, at the limit, QR get back in action when a cluster is composed of 4 vertices . That said, the rigid frame 'feature' goal is to enable to create 'volumetric stuff' quickly without tetrahedral meshing, that a common need for games, something better will be needed for fracture/plasticity.

Nat.

Antonio Martini
Posts: 135
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

### Re: Soft bodies early preview

Nathanael wrote:>Thinking about it, the M matrix is symmetric, there must exist a better (non iterative) way to extract a polar decomposition. if polar >decomposition ever become a bottleneck, i should get back to it.

Never mind, that's wrong.

Nat.
from the back of my mind the non iterative approach aside from QR which isn't perfect, involves solving a eigenvalue/vector problem and so solving a cubic equation in this case.

from:
http://en.wikipedia.org/wiki/Symmetric_matrix

"Every real symmetric matrix is Hermitian, and therefore all its eigenvalues are real"

"Another way of stating the real spectral theorem is that the eigenvectors of a symmetric matrix are orthogonal. More precisely, a matrix is symmetric if and only if it has an orthonormal basis of eigenvectors."

http://www.geometrictools.com/Documenta ... ric3x3.pdf
http://www.geometrictools.com/Documenta ... ricNxN.pdf

cheers,
Antonio
Last edited by Antonio Martini on Sun Apr 06, 2008 7:43 pm, edited 1 time in total.

Nathanael
Posts: 78
Joined: Mon Nov 13, 2006 1:44 am

### Re: Soft bodies early preview

Antonio Martini wrote:it happens but some methods seem numerically more robust and can recover gracefully
I did test it, each application of gradient correction does in fact recover from sign inversion through (graceful:)) rotations, that could be a problem for one element, but usually more than one tetrahedron share a vertex, so its not an issue. I guess it should be possible to setup a configuration where corrections cancel each others and the inverted tetrahedron stay in inverted state, but in real situation i don't see it happening often (if at all), experience will tell.

Thanks, Nat.

Antonio Martini
Posts: 135
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

### Re: Soft bodies early preview

Nathanael wrote:
Antonio Martini wrote:it happens but some methods seem numerically more robust and can recover gracefully
I did test it, each application of gradient correction does in fact recover from sign inversion through (graceful:)) rotations, that could be a problem for one element, but usually more than one tetrahedron share a vertex, so its not an issue. I guess it should be possible to setup a configuration where corrections cancel each others and the inverted tetrahedron stay in inverted state, but in real situation i don't see it happening often (if at all), experience will tell.

Thanks, Nat.
if you have not read it yet, see also section 4.1 still of:
http://www-evasion.imag.fr/Publications ... /NPF05.pdf

the requirements for dealing with inversion would be the following:

- must recover from an inverted state.
- must be numerically robust.
- the result must be visually plausible.

i have never detected any visible artifacts with complex meshes. Now it is not perfect, but the method of conserving volume by displacing vertices relative to the mass center doesn't meet any of the above requirements and as you pointed out it is not robust even before inversion happens. This without considering the problem of physical correctness of the constraint enforcement method mentioned in previous posts.

cheers,
Antonio

Antonio Martini
Posts: 135
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

### Re: Soft bodies early preview

just to recap as here i get the feeling that far too many methods have been discussed together. For volumes you are basically using shape matching as in:

http://www.matthiasmueller.info/publica ... _SIG05.pdf

where for now you only have one cluster of vertices right? if so in it's basic formthere is no explicit volume conservation constraint(something is mentioned as a variant at the end of section 4.2) and all the considerations on momentum conservation mentioned in the paper apply.

you maybe interested in having a look at defcolstudio 1.0.0 where a few methods for deformations were implemented:

http://cg.informatik.uni-freiburg.de/software.htm

when using tetrahedral meshes typically the artwork is interpolated inside it by the use of barycentric coordinates.
See for example the following demo where it is possible to switch between art/simulated mesh:

http://www.matthiasmueller.info/demos/physicsDemo.zip

so a tetrahedron is playing a similar role to a cluster in the shape matching approach. For example we can have a cube made up of a few tetrahedra and have a very complicated artwork interpolated inside it.
im not trying to say that one approach is better than the other just pointing out similarities.

the main problem i can see with shape matching is deformableVsDeformable collision detection which could be very slow given the lack of extra information. Also fracture seems a bit tricky, on the good side it can handle very stiff bodies.

cheers,
Antonio

amirishere
Posts: 7
Joined: Wed Mar 26, 2008 9:26 am

### Re: Soft bodies early preview

Way too cool!

ngaloppo
Posts: 11
Joined: Wed Dec 06, 2006 1:59 am
Location: Chapel Hill, NC

### Re: Soft bodies early preview

I am confused. Which of Matthias' methods is used? Stiffness Warping (aka Virtual Materials) or Shape Matching?

Stiffness Warping:
M. Müller, M. Gross, Interactive Virtual Materials, in Proceedings of Graphics Interface (GI 2004), pp 239-246, London, Ontario, Canada, May 17-19, 2004. (http://www.matthiasmueller.info/publications/GI2004.pdf)

Shape Matching:
M. Müller, B. Heidelberger, M. Teschner, M. Gross, Meshless Deformations Based on Shape Matching, in Proceedings of SIGGRAPH'05, pp 471-478, Los Angeles, USA, July 31 - August 4, 2005 (http://www.matthiasmueller.info/publica ... _SIG05.pdf)

Nathanael
Posts: 78
Joined: Mon Nov 13, 2006 1:44 am

### Re: Soft bodies early preview

That's shape matching, you can take a look at 'Init_BunnyMatch' and 'Init_TorusMatch' methods in SoftDemo.cpp.

Nathanael.

Strahlemann
Posts: 1
Joined: Tue May 26, 2009 12:03 pm

### Re: Soft bodies early preview

Hey guys. Currently i have some problems in computing the gradients for the volume-constraints in the paper "Position Based Dynamics". Has somebody found the the gradients?

Erwin Coumans
Posts: 4073
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

### Re: Soft bodies early preview

Strahlemann wrote:Hey guys. Currently i have some problems in computing the gradients for the volume-constraints in the paper "Position Based Dynamics". Has somebody found the the gradients?
Those gradients are discussed in this thread. Do you have details on what problem you face exactly?

Thanks,
Erwin

Dirk Gregorius
Posts: 873
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

### Re: Soft bodies early preview

I sketch the gradients for you quickly:
C(p1, p2, p3, p4) = | (p2 - p1) * [(p3 - p1) x (p4 - p1)] | / 6 - V0

We can translate the vertices without effecting the gradients. For simplification we move p1 into the origin =>
p1' = 0
p2' = p2 - p1
p3' = p3 - p1
p4' = p4 - p1

The simplified constraint becomes:
C'(p2', p3', p4') = | p2' * (p3' x p4') | / 6 - V0

Now in order to find the gradients we build the time derivative and identify the gradients by inspection. This was suggested e.g. by A. Shabana in "Computational Dynamics" and introduced to the game physic community by Erin Catto (to my knowledge).
dC'/dt = [ p2' * (p3' x p4') ] / | p2' * (p3' x p4') | / 6 * [ ( p3' x p4' ) * v2' - ( p2' x p4' ) * v3' + ( p2' x p3' ) * v4' ]

Define V = p2' * (p3' x p4') we get
dC'/dt = V / | V | / 6 * [ ( p3' x p4' ) * v2' - ( p2' x p4' ) * v3' + ( p2' x p3' ) * v4' ]