A simple cloth simulation can be done using the following algorithm:
def tick(dt):
for p1 in particles:
for bound in p.bounds:
p2 = bound.particle
p2.vel += p1.pos + bound.stable_pos - p2.pos
p1.pos += p1.vel * dt
As a test, I've tried implementing it in JavaScript. Unfortunately, this scales poorly. The performance drops very fast with the number of particles and the limit is very low. Is there a way to parallelize this algorithm? Could you describe it as a simple pseudocode?
Here is a detailed description of a parallel cloth simulation design: http://atarazanas.sci.uma.es/docs/tesisuma/16614860.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With