Page 3 of 3

Re: Soft bodies early preview

Posted: Sat Mar 22, 2008 1:42 pm
by Antonio Martini
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

Re: Soft bodies early preview

Posted: Sat Mar 22, 2008 2:15 pm
by Nathanael
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 :wink: . 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.

Re: Soft bodies early preview

Posted: Sat Mar 22, 2008 2:29 pm
by Antonio Martini
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."

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

cheers,
Antonio

Re: Soft bodies early preview

Posted: Sun Mar 23, 2008 2:46 am
by Nathanael
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.

Re: Soft bodies early preview

Posted: Sun Mar 23, 2008 4:39 am
by Antonio Martini
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

Re: Soft bodies early preview

Posted: Mon Mar 24, 2008 5:05 pm
by Antonio Martini
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

Re: Soft bodies early preview

Posted: Thu Mar 27, 2008 12:04 pm
by amirishere
Way too cool! :shock:

Re: Soft bodies early preview

Posted: Mon Jul 28, 2008 7:47 pm
by ngaloppo
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)

Re: Soft bodies early preview

Posted: Fri Aug 08, 2008 10:22 am
by Nathanael
That's shape matching, you can take a look at 'Init_BunnyMatch' and 'Init_TorusMatch' methods in SoftDemo.cpp.

Nathanael.

Re: Soft bodies early preview

Posted: Mon Jun 01, 2009 9:02 pm
by Strahlemann
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?

Re: Soft bodies early preview

Posted: Fri Jun 05, 2009 6:31 pm
by Erwin Coumans
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

Re: Soft bodies early preview

Posted: Sun Jun 07, 2009 9:48 am
by Dirk Gregorius
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' ]

The gradients are:
dC/dp4 = dC'/dp4' = sign( V ) * ( p2' x p3' ) / 6
dC/dp3 = dC'/dp3' = -sign( V ) * ( p2' x p4' ) / 6
dC/dp2 = dC'/dp2' = sign( V ) * ( p3' x p4' ) / 6
dC/dp1 = -dC/dp2 - dC/dp3 - dC/dp4


Is this different to the gradients in the Muller paper or the gradients discussed in this tread?


HTH,
-Dirk