Obi Official Forum
Grabbing physics reaction to softbody/ Grasping an organ for my project - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: Grabbing physics reaction to softbody/ Grasping an organ for my project (/thread-3027.html)



Grabbing physics reaction to softbody/ Grasping an organ for my project - sanchitgng - 19-07-2021

I want to grasp the gall bladder(softbody) with an instrument like shown in the picture, 
the grasper instrument is grabbing the gall bladder, it is functioning fine but the bladder grabbing is not looking realistic cause it is not reacting to the instrument force(it should be like pinching a softbody) 
it should look pinched/stretched just like a skin would would do with a grasper instrument.
How to achieve that?
This asset isw pretty new to me so please explain considering that.


RE: Grabbing physics reaction to softbody/ Grasping an organ for my project - josemendez - 19-07-2021

Hi there!

How's grasping currently implemented in your project? I can't really tell what's wrong or if the approach you took is correct if you don't describe what you're currently doing.

Softbodies are just a collection of particles, related to each other via constraints. When you grab a softbody, using an attachment is the most robust way. This means a particle or a group of particles follows the position of a target transform (in this case, the grasper instrument).

However grasping a single particle will not "pinch" the softbody, since a single particle is well, just a point in space. It's impossible to deform a single point in space (this should be just common sense, all you can do with a single point is translate ), so you need to grab multiple particles at once -multiple points in space- and move them relative to each other, such that they deform in the way you need.

Note that the more particles you use to represent your object, the higher the fidelity of the simulation. Any grabbing/pinching will look more detailed.

kind regards,


RE: Grabbing physics reaction to softbody/ Grasping an organ for my project - sanchitgng - 19-07-2021

(19-07-2021, 10:52 AM)josemendez Wrote: Hi there!

How's grasping currently implemented in your project? I can't really tell what's wrong or if the approach you took is correct if you don't describe what you're currently doing.

Softbodies are just a collection of particles, related to each other via constraints. When you grab a softbody, using an attachment is the most robust way. This means a particle or a group of particles follows the position of a target transform (in this case, the grasper instrument).

However grasping a single particle will not "pinch" the softbody, since a single particle is well, just a point in space. It's impossible to deform a single point in space (this should be just common sense, all you can do with a single point is translate ), so you need to grab multiple particles at once -multiple points in space- and move them relative to each other, such that they deform in the way you need.

Note that the more particles you use to represent your object, the higher the fidelity of the simulation. Any grabbing/pinching will look more detailed.

kind regards,
Actually, for grasping I am using the default particle picker with the line renderer, I aligned the instrument with the particle picker so it seems that it's the instrument that is doing it, I was sceptical about this process, grasping thing itself. maybe you can help, please,
can you please tell me how to implement proper grasping then? if there's any better method please tell me, better if you can include code that can help me setting up this grasping thing, it's an issue for many.


RE: Grabbing physics reaction to softbody/ Grasping an organ for my project - josemendez - 20-07-2021

(19-07-2021, 03:50 PM)sanchitgng Wrote: Actually, for grasping I am using the default particle picker with the line renderer, I aligned the instrument with the particle picker so it seems that it's the instrument that is doing it, I was sceptical about this process, grasping thing itself. maybe you can help, please,
can you please tell me how to implement proper grasping then? if there's any better method please tell me, better if you can include code that can help me setting up this grasping thing, it's an issue for many.

There's a lot of ways to implement grabbing, probably as many as use cases you can think of. Obi already includes many ways to do this: ObiParticlePicker, ObiParticleAttachment, ObiContactGrabber, etc. These allow you to grab particles using a screen-based raycast, attach them to existing transforms/rigidbodies, or grab them in response to a collision with a certain object.

None of them are an exact fit for your use case (bite/pinch the softbody and create wrinkles around it), so you will have to write your own approach. That's what the particle API is designed for:

http://obi.virtualmethodstudio.com/manual/6.2/scriptingparticles.html

All existing grabbing methods described above are built on top of this API. You might also find queries and collision callbacks useful:
http://obi.virtualmethodstudio.com/manual/6.2/scriptingqueries.html
http://obi.virtualmethodstudio.com/manual/6.2/scriptingcollisions.html

kind regards,