Curtain Physics animation

Hello I’ve been trying to research and work on a project , to have a curtain with certain physics that when dragged to the right or left it should implement a real life curtain experience I was trying to add a plane and get its position vertices to add spheres and link them in order to use them as imposters , in that way maybe I can get that experience, it didn’t work yet I wanted to ask if there is a better idea ? And if not where to start maybe ?

I used this playground as a reference : https://www.babylonjs-playground.com/#1J3WEP#3

followed a little of its steps but it didn’t work on an imported Model, I hope you guys can help,

Best Regards

Hello and welcome to the Babylon community! Can you show us a Playground with what you tried with your imported model? I can imagine it will need adjustments to account for being a custom mesh. We also have a Cloth soft body impostor, but it also uses the default ground mesh: Soft Bodies | Babylon.js Documentation (babylonjs.com)

2 Likes

Hello thank you , I added a simple plane done through 3ds max in this following playground link

this is what I’m testing on

Best Regards

looks like it could use some dampening

You’ll need to keep in mind that the ground on the example PG and your ground mesh have a different number of vertices and faces:
This is the example Ground
image
And in your PG:
image

Hello sorry for the late response I was testing and trying different objects , so basically the physics and cloth soft body imposter doesn’t work if the mesh is imported ? it works only on certain objects created via Babylon, please correct me if I’m wrong

The Cloth Impostor is only for Ground Meshes (@Cedric correct me if I’m wrong), but the other physics impostors are applicable to any mesh, even imported ones.

The cloth impostor can be used by any mesh. I used it for tshirt in a prototype some months ago.
1 question tho, what do you want to curtain to do? if it’s only an animation for opening/closing, then maybe going full realtime is not the solution. And baking the animation would be simpler, better quality and would use way less CPU?

something else to evaluate:

I think this tailored solution will need a bit more work but it will use less memory and will be faster to initialize as it’s more specialized than the generic ammojs/physics version.

1 Like

Thank you for your reply Cedric, I will take baking an animation into consideration but I had in mind to make the interaction with the curtains to be like the cloth simulation effect too, I will try using the link u sent to make it happen and maybe I will get back if there is anymore questions

Best Regards

1 Like