Hacker News new | ask | show | jobs
by tsherif 3288 days ago
Yeah, I was fiddling with the parameters until I found something I kind of liked. A couple of important factors:

1. Stiffness of the cloth depends on the number of particles vs. the number of iterations you do to resolve the constraints (maybe there's a way to speed this up?). So making things stiffer (at the same grid resolution) does take more time.

2. The faster things are moving, the higher the likelihood that that collisions will be missed. You can already see this if you move the ball very quickly, it can pass through the cloth. With higher gravity, I found the cloth would often get pushed through the ball.

If you want to fiddle around with it, you can clone and tweak the physics parameters here:https://github.com/tsherif/picogl.js/blob/master/examples/cl... and the simulation parameters here: https://github.com/tsherif/picogl.js/blob/master/examples/cl...