Coding Math: Episode 36 - Verlet Integration Part I

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 57

  • @zealous_carrot8744
    @zealous_carrot8744 2 года назад +5

    even after 6+years its the best explainations so far

  • @TheEricnorman
    @TheEricnorman 9 лет назад +41

    This is the most useful tutorials of math for programming I've ever seen. Nice!

  • @Edifier1221
    @Edifier1221 9 лет назад +13

    I cant belive you dont have more views, this is gold. Thanks for taking the time to make this vids!!

  • @thinkandmove479
    @thinkandmove479 Год назад

    That "Say may name!"-part spoke out of my heart. 🙂

    • @thinkandmove479
      @thinkandmove479 Год назад

      BTW: it's not "Runge-Kutta" with 'g' like in 'geography', but with 'g' like in 'go'. 🙂

  • @Mayur7Garg
    @Mayur7Garg 3 года назад +3

    Came here after Sebastian Lague's latest video. Worth it!

  • @monke2220
    @monke2220 Год назад +2

    truly a verlet integration moment

  • @ULTRAsoulBRAWLER
    @ULTRAsoulBRAWLER 9 лет назад +14

    This is by far the only good explanation of Verlet integration I've found in the last 2 days. It's a shame only one part is out so far. :(

    • @KeithPeters
      @KeithPeters 9 лет назад +4

      I'm in the middle of working on Part II as I write this. Should finish it up by the end of the weekend.

    • @ULTRAsoulBRAWLER
      @ULTRAsoulBRAWLER 9 лет назад +1

      Keith Peters Looking forward to it. Sadly end of the weekend won't help me out for the assignment I'm trying to do but at least I'll finally understand this topic for the final exam.

    • @KeithPeters
      @KeithPeters 9 лет назад +1

      ULTRAsoulBRAWLER oh.... sorry, bad timing there.

    • @ULTRAsoulBRAWLER
      @ULTRAsoulBRAWLER 9 лет назад +2

      Keith Peters No need to be sorry. I'm grateful this video exists so I can use it as a basis of knowledge for the subject.

  • @bigpapsi
    @bigpapsi 2 года назад

    Very good explained. Will watch the other videos! Did you inow your old blog was one of the reasons i got into programming like … 16 years ago 😮

  • @lucaug10
    @lucaug10 9 лет назад +3

    Can't believe we're getting into numerical analysis, great video!

  • @khatharrmalkavian3306
    @khatharrmalkavian3306 3 года назад

    Alternate bounce algo:
    if(x < 0) {
    oldx = -oldx;
    x = -x;
    }
    if(x > width) {
    var dw = width * 2; //this should be stored external to this function, but I put it here for simplicity
    oldx = dw - oldx;
    x = dw - x;
    }
    Explanation of the width * 2:
    The oldx will be n units from the edge, but you want to put it on the opposite side, so you calculate n as [width - oldx] and add that to width.
    width + (width - oldx)
    (width + width) - oldx
    (2 * width) - oldx
    The method in the video introduces latency (possibly simulating collision elasticity) when it sets the new x value to the edge instead of offsetting it.

  • @someguy4592
    @someguy4592 6 лет назад +3

    Anyone tried doing spring cloth with euler integration ? the result is so hilarious, it just becomes a shaking ball and goes out of control

  • @lorenzorossi2000
    @lorenzorossi2000 8 лет назад +8

    When it's bouncing off the wall shouldn't you find the collision point and set the ball there? And then you should calculate the little other piece that it should've done instead of bouncing off. This seems simple but it's not precise

  • @zealous_carrot8744
    @zealous_carrot8744 2 года назад

    you are so underrated!

  • @saltysandwiches3554
    @saltysandwiches3554 9 лет назад +1

    I was trying to do something similar to the stick demo with the elastic physics, but I think that using the verlet integration will improve it a lot.

    • @KeithPeters
      @KeithPeters 9 лет назад

      Yeah, you can do it with elasticity, but verlet lets you dial in the rigidity.

    • @saltysandwiches3554
      @saltysandwiches3554 9 лет назад

      Oh, ok, that's useful

  • @arttupakarinen7642
    @arttupakarinen7642 8 лет назад +1

    very nice did it in c++/SDL2 with this

  • @Silas_standley
    @Silas_standley 3 месяца назад

    WHEN ARE YOU GOING TO ADD A VIDEO ON ANGULAR CONSTRAINT LIKE THE LEGS ON THE EXAMPLE AT THE START OF THIS ONE

  • @UXER260
    @UXER260 Год назад

    how do you get the ball to stop bouncing? because in theory its energy should become less every bounce but will never actually come to a true stop.

  • @ArjunBkool
    @ArjunBkool 6 лет назад +1

    This is very useful, thank you. and very well explained.

  • @samsibbens8164
    @samsibbens8164 8 лет назад +1

    I've been looking for this everywhere! Thank you!

  • @seymurhamidov6091
    @seymurhamidov6091 3 месяца назад

    Great explanation ! Instant 👍 Like!!

  • @deepayanghosh7961
    @deepayanghosh7961 7 лет назад

    These videos are just awesome.
    Sir can you please make one on RK Method of integration??

  • @Polaroidon
    @Polaroidon 9 лет назад +2

    Super excited for the next part! Thanks!

  • @mathieug9860
    @mathieug9860 6 лет назад

    This works fine as long as your frame rate is constant. Doubling the frame rate will double the point velocity...

  • @AJ-et3vf
    @AJ-et3vf Год назад

    Awesome video! Thank you!

  • @anuraghazra4772
    @anuraghazra4772 6 лет назад

    Is there any way to simplify the modeling and management.. Like creating a module for making rects,circles,triangles etc?

  • @LucienWalters
    @LucienWalters 8 лет назад +2

    When bouncing the points off the right-hand wall, you set p.x to the room width. This doesn't account for it bouncing back into the room within the same frame, and makes p.y inaccurate. Should it not be `p.x = width - (p.x - width)` or more concisely `p.x = 2 × width - p.x`?

    • @KeithPeters
      @KeithPeters 8 лет назад +1

      Yes, not optimized for accuracy. More for simplicity and speed. Feel free to improve on it.

    • @elenalenaiva
      @elenalenaiva 6 лет назад

      the correct formula is much more simple and consistent. you've claimed to teach people mathematics, after all :)

    • @elenalenaiva
      @elenalenaiva 6 лет назад

      holy crap, I was soooo wrong :) Doing it my way makes it all so much more complicated further on.... Sorry, you were right ^_^

  • @ezequielleonzybert
    @ezequielleonzybert 2 года назад

    ruclips.net/video/3HjO_RGIjCU/видео.html
    Wouldn't be necessary to move the particle to make it lie on the dashed line? I mean, he moved it just on the horizontal axis to get it in the canvas again, but the particle would collide some pixels below that position, where the dashed line intersect with the canvas border.

  • @cheese3038
    @cheese3038 4 года назад

    best vid ever it actually made me understand how this verlet integration works thanks man

  • @pelegsap
    @pelegsap Год назад

    2:23 doesn't really apply when you live in Germany (or Austria and Switzerland for that matter)🤷🏼‍♀️

  • @DanWeatherman
    @DanWeatherman 9 лет назад

    Thanks for making these videos. Excellent brain candy!

  • @Bestmann3n
    @Bestmann3n 4 года назад

    thanks. brilliant video!

  • @voidex2156
    @voidex2156 9 лет назад

    This is great. Thank you very much.

  • @AfterthoughtTV
    @AfterthoughtTV 8 лет назад

    Hey, Coding Math, I have a quick question. I am using an engine with the y values flipped. How would I flip them in the code? I've tried several ways and cannot get it to reverse. Thanks for the vid btw!

    • @jdskale
      @jdskale 8 лет назад

      +Setfenv I know this is obvious but have you tried using a -y instead of +y ?

    • @AfterthoughtTV
      @AfterthoughtTV 8 лет назад

      Yes, I fixed it a long time ago. It was a lot easier than I than I thought XD

  • @guitarvoicing
    @guitarvoicing 9 лет назад

    Very nice! Congrats!

  • @Dragon20C
    @Dragon20C Год назад

    The point seems to never actually stop, hmm

  • @NickGeo25
    @NickGeo25 4 года назад

    Thanks for the video! Isn't the simulation framerate dependent though?

  • @ahmadkhalil94
    @ahmadkhalil94 8 лет назад

    You are my man!!

  • @hotdude549
    @hotdude549 4 года назад

    nice

  • @simonmultiverse6349
    @simonmultiverse6349 3 года назад +1

    Ha! You start off telling us how to pronounce "Euler", then at 3:47 you fail to pronounce "Runge-Kutta" properly!

    • @KeithPeters
      @KeithPeters 3 года назад +2

      :) I choose my battles. can't win them all.

  • @natgazer
    @natgazer Год назад

    Cooool!!!

  • @luiseduardocastroanaya6880
    @luiseduardocastroanaya6880 4 года назад

    Cool!!!

  • @landreeallen86
    @landreeallen86 8 лет назад

    7:45 Line 28 & 29:
    vx = p.x - p.oldx;