Cloth

(cloudofoz.com)

224 points | by memalign 5 hours ago

9 comments

  • mmwelt 2 hours ago
    Another one for the browser: https://oimo.io/works/cloth/
    • varun_ch 32 minutes ago
      such an unbelievably cool website.
    • rand0m4r 44 minutes ago
      simply lovely (like the other stuff on that website)
    • stefanka 46 minutes ago
      And another one (Rusty with bevy).. runs better on desktop
  • faeyanpiraat 9 minutes ago
    Is there a simple way to do fluid (air) simulations like this?
  • falcor84 1 hour ago
    This reminded me of this cool Polygon video examining the incredible cloth design in the game Elden Ring

    https://youtu.be/wSSqx-Dh6ko

  • rikroots 4 hours ago
    I've always loved this sort of cloth animation. I think the first one I saw was dissimulate's tearable cloth demo on Codepen - I can't believe they wrote that code 9 years ago!

    [1] - https://codepen.io/dissimulate/pen/eZxEBO

    [2] - https://github.com/Dissimulate/Tearable-Cloth

    • wingerlang 3 hours ago
      Here's mine from 14 years ago https://www.youtube.com/watch?v=G05M_Y6NQVM

      It's very simple to implement a basic setup like this, and I agree that the results are super cool.

    • ribcage 2 hours ago
      Video game Hitman from 2000 had cloth. Mirror's Edge from 2008 had tearable cloth. And I am pretty sure they weren't the first.
  • stefanka 58 minutes ago
    The author created some Godot addons. Is this made with Godot too? Would be a nice to have for a free game engine
    • __loam 42 minutes ago
      Godot can target the web so it's conceivable
  • sph 3 hours ago
    These cloth simulators always feel somewhat unstable - try generating a Grid cloth, and see it start bouncing and moving randomly. Is this due to accumulating IEEE 754 floating point errors?
    • Karliss 2 hours ago
      Search for "numerical integration" in the context of physics simulation/game engines. You can use https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary... as a starting point.

      From what I understand it's not just floating point errors, but due to the nature of approximating continues function as simple discrete steps. Linked wikipedia article has a graph demonstrating that with large steps the error accumulates way before floating point precision is a concern.

      There are different numeric integration techniques with different tradeoffs. Stuff like Eulers method, Verlet, Runge-Kutte. In some of them overall energy tends to accumulate in others it gets lost both of which is wrong. Some of the more complex ones tend to behave a bit better, but then you get into the problem whether gains from each individual step being more complex outweighs what you would get from running more iterations of simpler/faster algorithm.

      • rikroots 28 minutes ago
        I've got a demo[1] where people can play with (my interpretation of) various calculation engines, adjust variables, etc. But seeing this comment made me realise I've never heard of Verlet integration[2] before - not surprising given that I got an F in Maths (and got thrown out of Physics before I could take the exam). So ... how efficient and accurate is Verlet compared to Euler/Runge-Kutte/etc? And what other methods are out there for this sort of calculation?

        [1] - https://scrawl-v8.rikweb.org.uk/demo/particles-008.html

        [2] - https://en.wikipedia.org/wiki/Verlet_integration

      • Azrael3000 1 hour ago
        Would be interesting to know what integrator they use. Verlet schemes can be implemented with very little effort and they don't suffer from this issue (see e.g. the leap frog method). But in general you would nearly always add some sort of damping mechanism, particularly for CG applications.
    • praptak 22 minutes ago
      Energy preservation doesn't work by default in physics simulations unless you specifically code for it (e.g. by periodic explicit adjustment).

      It's not only the rounding error, it's also quantisation of time and other minor errors coming from the mathematical model itself.

      If the error is on the damping side, you get the real life effect of motion eventually stopping due to energy dissipation. If it's on the acceleration side you get a runaway simulation.

  • polotics 3 hours ago
    Does this mean I can finally get a robot to fold my shirts in ten years?
    • stefanka 48 minutes ago
      Simulating cloth for instance with spray damper models it’s quite old. Even older than robotics research on folding cloths—and it has progressed pretty far. See for a recent survey:

      https://arxiv.org/abs/2407.01361

    • DonHopkins 2 hours ago
      Yes, but you will have to wear a hinged stainless steel shirt that makes you look as ugly as a CyberTruck.
  • sashank_1509 4 hours ago
    So beautiful, robotics simulation can benefit from something like this. The state of cloth simulation in robotics is still pretty pathetic
  • brcmthrowaway 3 hours ago
    Is this the new Ciechanowski