How Games Simulate Cloth & Ropes

At the end of this video, you may have a broad concept of how to implement a cloth simulation algorithm in your own game.
You can take a look at the webgl + js game engine I'm developing using the cloth simulation I implemented in the video: github.com/Fangjun-Zhou/White-Dwarf
I've also published all the code in the video to the repository here: github.com/Fangjun-Zhou/cs559-cloth-simulation
References:
Simulating a Rope: owlree.blog/posts/simulating-a-rope.html

Пікірлер: 86

  • @charetjc
    @charetjc Жыл бұрын

    I don't know why, but your explanation of Verlet integration provided more insight into how it worked than any other source I've tried to digest. Well done.

  • @adrianovianawerneck472
    @adrianovianawerneck472 Жыл бұрын

    The birth of a dope programming channel begins

  • @jeremyvirin6532
    @jeremyvirin6532 Жыл бұрын

    Damn, this video is incredible, very well detailed, very well explain, the subject is very interesting,the transitions are beautiful, I love how the equations moves, keep up man, you are doing a very great job

  • @bmesa
    @bmesa Жыл бұрын

    What a great video man, please continue doing things like this!

  • @yuanyuan9852
    @yuanyuan9852 Жыл бұрын

    nice vid man keep on going with this kind of content, really an eye opener.

  • @yunusoloji
    @yunusoloji Жыл бұрын

    Dude it was an amazing video. Your explanation is very clear. I felt 3blue1brown vibes :). Please create more content like this.

  • @o_sch
    @o_sch Жыл бұрын

    Ima go to Madison for CS so I guess I may be doing this as well Also that was the best Verlet integration explanation I have seen. It actually made it all make sense

  • @ZedaZ80
    @ZedaZ80 Жыл бұрын

    This is such a good explanation, thanks!

  • @brandonwlee2013
    @brandonwlee201310 ай бұрын

    Dude, you need to make more videos. These are beautiful. I'm sure they're a ridiculous amount of work but they're phenomenal

  • @rickf6375
    @rickf6375 Жыл бұрын

    Oh, we just talked about something similar in terms of cfd-simulation but your animations really brought this to life

  • @tomasgeloso
    @tomasgeloso Жыл бұрын

    What a great video, please keep it up!

  • @uncoherentramblings2826
    @uncoherentramblings2826 Жыл бұрын

    Great stuff! Hope to see more ♥️

  • @matcyb
    @matcyb Жыл бұрын

    Really great video man!

  • @mrshodz
    @mrshodz8 күн бұрын

    Nice explanation.

  • @AJ-et3vf
    @AJ-et3vf Жыл бұрын

    Awesome video! Thank you!

  • @sheeshimsam3032
    @sheeshimsam3032 Жыл бұрын

    Holy s*** I didn't understand anything, but sounds really cool to see a bunch of vectorial concepts here

  • @TheEricon
    @TheEricon Жыл бұрын

    Amazing Video! my only recommendation is to lower music a bit when ur talking. Please make more vids, very educational.

  • @carloszavala4090
    @carloszavala4090 Жыл бұрын

    Nice video, keep them coming. :)

  • @correiaivan
    @correiaivan Жыл бұрын

    Looking forward to more uploads

  • @michaelsondei4695
    @michaelsondei4695 Жыл бұрын

    Great video! Next time, it would be great to highlight variables (or parts of equations) that you're talking about.

  • @northernafricas3329
    @northernafricas3329 Жыл бұрын

    Keep up man ... can we see some math related to design algorithms in programming logic

  • @tseringdhoundup2624
    @tseringdhoundup2624 Жыл бұрын

    keep making video on game i love to learn more

  • @AntonioNoack
    @AntonioNoack Жыл бұрын

    I wasn't expecting the Cities XL music at the end 😄

  • @abdousekhi4933
    @abdousekhi4933 Жыл бұрын

    nice vidéo bro🙌

  • @prodbyreve8660
    @prodbyreve8660 Жыл бұрын

    This video is a banger omg

  • @snailcat69
    @snailcat69 Жыл бұрын

    Nice tutorial, i like it bro

  • @shitshow_1
    @shitshow_1 Жыл бұрын

    Thanks for sharing : D

  • @TheRoy714
    @TheRoy714 Жыл бұрын

    Awesome!

  • @fascinating.fractals
    @fascinating.fractals Жыл бұрын

    Great video ! What tool do you use to create this video ? I mean writing the equation and animating graphs?

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    Animations are made with manim.

  • @9remi
    @9remi10 ай бұрын

    awesome vid. keep doing good work

  • @drabart6121
    @drabart6121 Жыл бұрын

    Great video, tho I'd make the algebra rearrangement animations a bit slower so they would be easier to make sense of

  • @nberz692
    @nberz692 Жыл бұрын

    Nice vid :)

  • @benmcreynolds8581
    @benmcreynolds8581 Жыл бұрын

    There is nothing in the world that makes games more fun than good physics. Gameplay mechanics that are physics based, with Physics effects, add so much depth to the gameplay it's not even funny. It's awesome! It's been too long lately that most games have only cared about Ray Tracing, graphics and micro transactions. It's time that games bring back the fun in video games by focusing again on the importance of physics effects in their game's. Trust me, if devs/companies care about "money/profits" well the best way is to get players to LOVE playing your game. Gamers love playing around with physics effects in gaming world's. I know at least I do.

  • @DaveLeCompte
    @DaveLeCompte Жыл бұрын

    The Jakobsen Hitman Physics was one of the best GDC talks I ever attended. Paper here: www.cs.cmu.edu/afs/cs/academic/class/15462-s13/www/lec_slides/Jakobsen.pdf

  • @stenzenneznets
    @stenzenneznets Жыл бұрын

    Hi guys, I need to simulate a rope without the influence of gravity like it's resting on a plane. I need to draw it first, for example using the mouse or a graphics tablet, and then be able to pull an extremity and record the result. What kind of language should I use? There is something similar already developed? Thank you so much.

  • @benmcreynolds8581
    @benmcreynolds8581 Жыл бұрын

    I would love to see an invention (similar to photogrammetry) but it let's game devs actually create in game physics effects based off of inputted art or video. (Example: you take a video of (insert real world situation) water droplet💧 landing in a puddle of water?)~ so then you upload that or any other representation of physical behavior, to your game engine, and the new invention could take that video or art animation and create a interpretation of code for THAT behavior and then it can basically help devs reverse engineer physics effects code from real world footage of physical behavior. (Idk if this makes any sense, or if this kind of thing would ever be possible but it pretty much would be a video game creators dream invention in my opinion.) Think of the game builds that could occur if this kind of creativity could be given to game devs. Since currently devs have to do so much tediousness to create things. This could really let the imagination go wild if something like this comes around.

  • @henrycowsert3999
    @henrycowsert3999 Жыл бұрын

    🎉 more more more 🎉

  • @jhanolaer8286
    @jhanolaer8286 Жыл бұрын

    should fix kspring constant of each vertex to keep rest length balance.In real world of physics i always recommend spring mass simulation than verlet❤

  • @Spedley_2142
    @Spedley_2142 Жыл бұрын

    I remember 30 years ago there was a 1 line BBC Basic program called rope which simulated a rope at the mouse pointer. Has anyone got a copy?

  • @jerrydaboss1
    @jerrydaboss1 Жыл бұрын

    6:49, shouldn't f''(t) be the acceleration, not the velocity?

  • @Galakyllz
    @Galakyllz Жыл бұрын

    Great video but that song at the end was a bit loud.

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    I’ll fix that in the future!

  • @user-hb7py7xy7b
    @user-hb7py7xy7b Жыл бұрын

    I don't understand: why are we using loop instead of moving each point single time. We move the first one and lock it's position, calculate constraint, move second one and locked it's position, go to the fird one. Basically it wouldn't matter how many points we have we just need to find and lock position for n-1 point. Am I missing something?

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    If you are simulating a rope with one fixed point, this may work. But think about a cloth where each node connects to multiple nodes, moving a node may break other constraints. It’s a little bit tricky (´▽`)

  • @andrasgilicz8153
    @andrasgilicz8153 Жыл бұрын

    Very nice 👍How you did this cool animations?

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    I use manim for these animations.

  • @poutineausyropderable7108
    @poutineausyropderable71087 ай бұрын

    6:45 f''(t) = velocity of object: No Acceleration of object: yes

  • @lapatatadelplato6520
    @lapatatadelplato6520 Жыл бұрын

    Would it be possible to do something like Gaussian quadrature? I don’t know much about graphics, but I have used the process for arc length parametrization of a Bézier curve.

  • @lapatatadelplato6520

    @lapatatadelplato6520

    Жыл бұрын

    It worked quite well

  • @aneeshsrinivas9088

    @aneeshsrinivas9088

    Жыл бұрын

    I was thinking something like that too.

  • @yusufwafiy6347
    @yusufwafiy6347 Жыл бұрын

    Damnn..1.5k subs only by 1 videos

  • @klevisimeri607
    @klevisimeri607 Жыл бұрын

    👍

  • @DoruksWork
    @DoruksWork Жыл бұрын

    Hi i'm a student and I would like to try to implement this. Do you think python would be too slow to compute this or is it good enough.

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    If you want to implement a real-time cloth simulation, python might be slow. But if you want to render the simulation result to a video, python is OK!

  • @NostraDavid2

    @NostraDavid2

    Жыл бұрын

    Yeah, it should be fine. Computers are plenty powerful nowadays. Don't sweat python being slow, because if it is, you can find ways to make it faster.

  • @NostraDavid2

    @NostraDavid2

    Жыл бұрын

    And I say this as someone who bangs the "python is too damn slow" drum, and use it professionally every day. You're a student. You should worry about getting working code, and learning other concepts related to your courses :)

  • @correiaivan
    @correiaivan Жыл бұрын

    I was wondering if it's that way Marvelous Designer works

  • @S3Kglitches
    @S3Kglitches Жыл бұрын

    3:05 it's called "delta" for "difference"

  • @o0QuAdSh0t0o

    @o0QuAdSh0t0o

    Жыл бұрын

    or change

  • @tj_1260
    @tj_1260 Жыл бұрын

    wild

  • @danwu7275
    @danwu7275 Жыл бұрын

    where I can take this course?

  • @DogeMultiverse
    @DogeMultiverse Жыл бұрын

    Ending music is too loud.

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    I’ll fix it next time!

  • @abiuniverse
    @abiuniverse Жыл бұрын

    Can I create these graphics with intractability (with mouse/keyboard) and text in Python as well?

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    Do you mean the animation I made for the video or the cloth simulation? If you are asking about the visualization animation in the video, I made those clips with manim. I remember there’s an interactive version of manim. You may search for it on the GitHub.

  • @abiuniverse

    @abiuniverse

    Жыл бұрын

    @@depth-buffer thank you for the reply, as far as I know manim only does 2D animation and you showed the cloth simulation inside a 3D cube inside a browser window. I only know Python for now so I was wondering if all this is possible to do in python because with matplotlib animation it takes ages to even make a decent animation and yours looked so smooth, fluid and interactive.

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    @@abiuniverse manim do support 3D rendering. You can try it with python.

  • @abiuniverse

    @abiuniverse

    Жыл бұрын

    @@depth-buffer thank you

  • @sediew
    @sediew Жыл бұрын

    maybe physics class was more important than i thought

  • @torcher5023
    @torcher5023 Жыл бұрын

    Who can explain me this: If know my force F, then I just can calculate acceleration using Newton's second law: a = F/m, then v = at and then x = vt. Why do I need any integration techniques here, Taylor series and other stuff? Complete nonsense for me.

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    When you just apply Newton‘s second law, the error will be larger than Verlet integration method.

  • @theLollox1000

    @theLollox1000

    Жыл бұрын

    you are assuming constant force, hence constant acceleration, and v =at (x=vt) Is just the result of integrating a constant!

  • @torcher5023

    @torcher5023

    Жыл бұрын

    @@theLollox1000 finally get it, thanks

  • @nagoshi01

    @nagoshi01

    Жыл бұрын

    One facet of this is that the normal Euler's method is a first-order approximation (AKA first order integrator). If you look up the Wikipedia page on Energy Drift, it goes into detail of how ballooning energy levels of your simulation result from the relationship between your time step length and the error in the energy of the system. Euler method leads to a energy drift proportional to Δt. Verlet integration is a second order approximation, and its error thus proportional to Δt^2 Remember that the smaller the timestep is, the more computations per second you have to do, so making Δt smaller and smaller is not easy. At a certain point it's more computational efficient to add an extra term to the position function than it is to decrease your timestep. These kinds of things pop up all the time in physics and engineering. There are even higher order physics simulations, like cubic and quartic ones used for extreme precision like simulating molecular motion for things like drug design. There are more important differences, primarily how these methods stay true to the system's Hamiltonian, but that is out of scope for this comment.

  • @swamysriman7147
    @swamysriman714710 ай бұрын

    Bruh Do a video explaining the setup needed to write these engines...

  • @infegfx
    @infegfx Жыл бұрын

    Wow. I was thinking this. this can be different way. I can explain you my idea ifyou want. You have to add just 1 more unit formula and it can be also act like other particalsi materials and ... It will be interesting. Just 1 think I have to say. I do not know anythink about coding.

  • @Pseudowaifu
    @Pseudowaifu Жыл бұрын

    Nice. Perfect?

  • @Pseudowaifu

    @Pseudowaifu

    Жыл бұрын

    Interesting, yes

  • @shulehr
    @shulehr3 ай бұрын

    people don't actually use springs for ropes/cloth. It's not only unstable but also unrealistic

  • @Grayson_Wu
    @Grayson_Wu Жыл бұрын

    大佬有B站账号吗,关注一手(我看你书签栏有B站) 另外这视频有打算发B站吗,我去三连一下

  • @depth-buffer

    @depth-buffer

    Жыл бұрын

    B站同名

  • @Jkauppa
    @Jkauppa Жыл бұрын

    meh, you should say "how graphics model editors simulate clothing", game does not have to do any of that, leave that to blender to do

  • @emretekmen1602
    @emretekmen1602 Жыл бұрын

    what school do you go to

  • @AMFLearning
    @AMFLearning Жыл бұрын

    #amflearningbydoing #amflearning awesome

  • @anthonysteinerv
    @anthonysteinerv Жыл бұрын

    How can I take your CG course?