Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find out which particle group to attach with the ObiParticleAttachment
#6
(11-08-2021, 11:33 AM)josemendez Wrote: Attachments work on particle groups, they can't work on individual particles. This being said, creating one particle group per particle is a perfectly valid approach. You can do this programmatically if you don't want to do it by hand in the editor.


There's at least two other ways to attach particles: set their inverseMass to zero (disables dynamics) and then set their position to whatever value you desire:
http://obi.virtualmethodstudio.com/manua...icles.html

or add pin constraints:
http://obi.virtualmethodstudio.com/manua...aints.html

See for instance the sample /Obi/Scripts/Common/Utils/ObiContactGrabber.cs script: it uses the first approach to attach particles to objects they collide with.


Obi is a position-based engine, so internally no forces are used. Shape-matching in particular (the algorithm used for softbody simulation) works with deformation tensors. Each particle and its close neighbors are considered a shape-matching cluster, the algorithm strives to keep the rotationally invariant shape of each of these clusters during simulation. The deformation for each cluster is stored as a 3x3 matrix. For more info: https://matthias-research.github.io/page...ticles.pdf

You can get the 3x3 deformation matrix for each shape matching cluster, and use its trace as a scalar measure of deformation. See the included "DeformationGradient" sample scene: it maps deformation to a vertex color gradient for visualization.


Hello, I looked at the DeformationToColors.cs script, and as you said it only shows how to get the scalar part of the deformation. What I care more is actually the direction, if I want to get the direction in which a particle is being "pulled" from its surrounding particles, do I look at the particles that are within the same "cluster"? Is there a way to access the cluster data of a soft body actor?

I'm currently working on simulating penetrating a soft body using another rigid object or an Obi rope. I want to simulate the movement of the point of penetration on the soft body along the object that's penetrating it, and my current plan is to set up a bunch of attaching positions on the penetrating object, then analyze the "force" that's currently "pulling " on the particle which is going to be attached on one of those attaching positions, and decide which direction the attached particle should move towards. Do you think this is a good way to approach this situation? Or Obi has a more built-in solution for this type of simulation?
Reply


Messages In This Thread
RE: Find out which particle group to attach with the ObiParticleAttachment - by snowtv - 16-08-2021, 08:35 PM