Software Engineer
Loading posts...
Feel free to contact me at kanishksachdev@gmail.com
Cloth in a game or film is not one solid sheet, it is a grid of tiny point masses tied together by springs. Let gravity pull on the points, keep the springs close to their rest length, and the whole thing drapes and swings like real fabric.
Pick how it hangs, a curtain, a banner, a flag, or a hammock, then grab a handful and drag it around. Turn up the wind, or switch to Tear and slice it open. Each patch is shaded by how stretched it is, from relaxed teal to strained red, and if you pull hard enough the threads snap on their own.
Grab a handful of fabric and pull; colour shows how stretched each patch is. Yank hard enough and it tears.
This is a mass-spring system solved with two moves each frame, a technique from Thomas Jakobsen's work on the physics in Hitman: Codename 47:
Tearing is almost free: once a spring is pulled past a threshold, just delete it. Do that to enough neighbours and the fabric splits, no special case required.