Cloth Simulation
39 comments
·December 2, 2025clbrmbr
eddieroger
I think the little tears were fine, but my expectation of the weight of the cloth wasn't so much that it would start to rip on its own after a certain point. It felt more like a wet dough at a certain point than cloth.
cloudfudge
It's rust compiled to wasm. Dude's got a lot of interesting stuff on his projects page: https://mikail-khan.com/portfolio
OptionOfT
I remember the first time playing Splinter Cell.
Walking back and forth through a curtain to see how it wraps around the body. So cool.
jeffreygoesto
For me, "Large Steps in Cloth Simulation" [0] made implicit methods accessible... Seminal paper.
chombier
For inextensible cloth there's also "Efficient simulation of inextensible cloth" [0] that is particularly clever and efficient
atan2
A very nice article by Marian Pekár on Verlet integration and cloth simulation:
https://pikuma.com/blog/verlet-integration-2d-cloth-physics-...
bogtog
It tearing when I waved my mouse around was a nice surprise
sliken
Nice first approximation. The cloth has no momentum, a piece of cloth that clearly would swing down, past vertical, and then swing up just damps down and stops at vertical.
Also the falling pieces don't accelerate downward, which looks unnatural
flet
I like it!
I made this a bit ago for fun and funnies to test the idea of tearaway ads. It's very prototype but still pretty satisfying (desktop only but there's a gif on the repo)
Miraltar
Exactly as discussed in Sebastian Lague's video https://www.youtube.com/watch?v=PGk0rnyTa1U
TwoFx
I highly recommend watching the relevant section of that video (4:38 to 8:59) and then implementing it yourself in whatever system you know that can draw lines and circles (I did it in Godot; it took only a few minutes to learn enough Godot to start on the algorithm).
It's absolutely mind-blowing that so little code can produce such a beautiful result. It's also fun to play with the parameters and see how they affect how the cloth feels.
mclau153
would you share your godot code to github?
taeric
First, kudos on this. Really cool to play with.
Reminds me of a great video not long ago that went over the main ideas behind weaving and knitting. Feels like you almost certainly have to take some of those ideas in mind when doing a simulation like this. Would be curious to read a breakdown of how this was made and how it incorporates the concepts that go into different fabric.
fiiisssh
[dead]
LyalinDotCom
I was curious and was able to build something very similar quickly using Gemini 3 via Google AI Studio. Never would have imagined a few years ago how easy some of this has become to prototype.
cyber_kinetist
There's a lot of simple cloth sim examples on the internet, so I see why LLMs can code these kinds of demos easily.
LyalinDotCom
yeah makes sense. Im sitting here evolving my little prototype its too much fun.
jcims
The 'Build' feature in AI studio has been pretty incredible for a few use cases I've thrown at it.
samcheng
This is great! The only part that broke the immersion (for me) was that the cloth bits fell at a constant rate - I'd expect them to accelerate due to gravity, and maybe flutter as they fell.
Nice art!
The tearing was unexpectedly disturbing!
Suggestion: use an accelerometer data on mobile and use that to directly replace gravity. I expect to be able to tip the phone to drape the cloth, and shake the phone to get waves of motion.