Sign in to follow this  
Pryme8

Best way to do chain simulation

Recommended Posts

So here is a good technical hurdle.
https://www.babylonjs-playground.com/#7AHEVA#18

Trying to figure out the best way to do a interlinked chain and be able to do a physics simulation with it, the hurdle here is there will be 27 chain systems on the basket which makes things hard.

I am thinking the solution will be to use use physic linked cylinders and hide then from visibility then children the link impostors to the hidden cylinders.
This solution does not give the "slide" effect that happens between chain links though and so I am open to more ideas.

After being able to construct the chain the next part will be connecting it to two anchor points and having the chain hang correctly.
Another hard part will be the fact the end anchor point for all the chain systems is a ring that they are all connected to so when one chain system gets hit at min 12 systems will have to calculate.

Share this post


Link to post
Share on other sites

Have you ever played disc golf before?  This one might be a little hard to visualize unless you have seen a disc slam chains before.

I would need like sliders with ball and socket combined.

Share this post


Link to post
Share on other sites

https://www.babylonjs-playground.com/#NP3GK1#2

I am struggling with this.

I effectively want the links to be connected with a slider joint in the middle that allows for sliding on the y Axes only so that way the links and expand/compress.

It should effectively look like this:
https://www.babylonjs-playground.com/#NP3GK1#5
after they settle. 

*UPDATE* 
I was not using Oimo, which has the slider joint...  but I am still stuggling 1 second will post update.
https://www.babylonjs-playground.com/#NP3GK1#7
with one link it "works"
with two or more they disappear... 
for some reason I can never get the joints working correctly.


*UPDATE*
https://www.babylonjs-playground.com/#NP3GK1#8
Ok got the chain "Working" now I need to figure out to how to constrain the rotations and then how to connect multiple systems together.
https://www.babylonjs-playground.com/#NP3GK1#11

I also need to figure out how to make the connected effect less violent as the numbers increase.
https://www.babylonjs-playground.com/#NP3GK1#12
https://www.babylonjs-playground.com/#NP3GK1#13

Share this post


Link to post
Share on other sites

Ha, look at this thing just load itself up...  thats not right...
https://www.babylonjs-playground.com/#NP3GK1#15


https://www.babylonjs-playground.com/#NP3GK1#19
gotta figure out how to make it stop bouncing under its own weight.

*UPDATE*
https://www.babylonjs-playground.com/#NP3GK1#20
well I guess this kinda works, taking a mass of 1 dividing it by the number of links in the chain.  Then as it goes down remove the fraction of the mass away from the total as it goes down.  Only works up to an extent though.

Share this post


Link to post
Share on other sites

I was kinda thinking a softbody tube might make the cut.  Now you got me wanting to investigate that.

the problem would be connecting the soft bodies to the rings on the pole though, let me see if I can find an example video.

https://www.videoblocks.com/video/disc-golf-putt-throw-hits-the-basket-x0wecli

this video is kinda weak too, the chains can really get rocked sometimes with a good throw.

with the chain tutorial in blender does not take into account the sliding that the chains do, they do not stay fixed to each other in a single pivot point and that's what gives them their play.


Looks like my mass hack will work for now:
https://www.babylonjs-playground.com/#NP3GK1#21

Cause all I need is 26 chains per system.  Plus it kinda makes sense the mass would go like that (not really but ok), the top link has the cumulative weight of all below it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.