logoalt Hacker News

Cloth Simulation

190 pointsby adamch12/02/202537 commentsview on HN

Comments

clbrmbryesterday at 1:21 PM

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.

show 2 replies
slikentoday at 2:37 AM

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

cloudfudgeyesterday at 6:22 PM

It's rust compiled to wasm. Dude's got a lot of interesting stuff on his projects page: https://mikail-khan.com/portfolio

OptionOfTyesterday at 3:44 PM

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.

jeffreygoestoyesterday at 10:31 AM

For me, "Large Steps in Cloth Simulation" [0] made implicit methods accessible... Seminal paper.

[0] https://dl.acm.org/doi/10.1145/280814.280821

show 1 reply
atan2yesterday at 10:09 AM

A very nice article by Marian Pekár on Verlet integration and cloth simulation:

https://pikuma.com/blog/verlet-integration-2d-cloth-physics-...

fletyesterday at 10:04 PM

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)

https://github.com/Flet/tearaway

bogtogyesterday at 12:53 PM

It tearing when I waved my mouse around was a nice surprise

taericyesterday at 3:34 PM

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.

show 1 reply
Miraltaryesterday at 9:58 AM

Exactly as discussed in Sebastian Lague's video https://www.youtube.com/watch?v=PGk0rnyTa1U

show 1 reply
LyalinDotComyesterday at 5:22 PM

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.

show 2 replies
samchengyesterday at 4:11 PM

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!

jakemangeryesterday at 6:49 PM

That's super cool (and FAST -> hard to do from my personal attempts).

But, please, give us some nitty gritty of how you made it

show 1 reply
hoppersoftyesterday at 5:39 PM

I spent entirely too much time finding out exactly how much "cloth" could be supported by two "strings."

show 1 reply
rayladyesterday at 8:21 PM

Feels more like a spiderweb simulation. The fibers are sticky and stretchy.

RankingMemberyesterday at 3:47 PM

Pretty cool! I kept trying to cut the piece I had just cut again by doing a "Zorro"-style motion, but no such luck.

iberatoryesterday at 9:53 AM

Maya and Cloe 3D and almost all fashion design software have it for decades already. Niche and fascinating software. Check out some demos.

Cool stuff in software you don't even know exists:)

show 1 reply
robertheadleyyesterday at 4:28 PM

I wonder how far away we are from realtime Marvelous designer in games.

mrkrameryesterday at 4:30 PM

Reminds me of Fruit Ninja but this one is Cloth Ninja.

jan_Sateyesterday at 1:47 PM

Looks like that I can cut it without right click by swiping fast enough.