2.2: Applying a Force – The Nature of Code

[ad_1]
Chapter: 2

Official book website:

Twitter:

This video covers how to apply a force to a moving object in Processing. These forces are “made-up” values and don’t yet involve more complex formulae (coming soon!)

Read along:

Help us caption & translate this video!


Posted

in

by

Comments

20 responses to “2.2: Applying a Force – The Nature of Code”

  1. VideoProfess0r Avatar

    Every time the ball bounces against the wall, I lose 0.3 velocity…I can't figure out why….gravity force = 0.3…each time it hits the wall, i print out the velocity…15, 14.7, 14.4, 14.1…etc. until it sticks against the wall. What am I doing wrong?

  2. Suraj Jha Avatar

    I really love the way you teach sir , your lectures remind me that learning is supposed to be fun .

  3. Brendan Robertson Avatar

    So great, Thank you 😀

  4. Andrés Locatelli Avatar

    You are the best Daniel. I am learning math, english and processing with you. Thanks!

  5. Bradley Stone Avatar

    What if you wanted to apply force to the object when it's neutral, using your mouse or a key press, and display the object's acceleration and speed?

  6. Steven Barnes Avatar

    "All the forces since the dawn of time are now affecting me" = best comment ever!

  7. Elías Burgos Avatar

    I love you shiffman! hahah just you speak very quickly and I speak in spanish! hahah, thanks

  8. gghelis Avatar

    Your github links don't work 🙁

  9. JustSome Dude Avatar

    Hi thank you for the videos. I'm having a bit of trouble wrapping my head around this and implementing it in javascript.. How is velocity not spiriling out of control? And also I understand you can change the direction when hitting the bottom or walls by multiplying by 1 or -1 but how is the circle being pulled back down after it bounces (changing direction)? And is the pVector.add() function the same as accelleration.x += force.x; accelleration.y += force.y ? Thanks again.

  10. José Prelada Avatar

    Wow! 15:50 "i am such a loser…" you are not! You are just you and we love it XD I wish you could be my professor at every class! Keep up 🙂

  11. pycpyc Avatar

    Sir, you are a master and a poet ! Thank you so much for making the world a better place !

  12. arbiru frye Avatar

    I give the thumb up
    even before watching
    u r a great man Daniel 🙂

  13. yannnick erpelding Avatar

    Blows 'I'm such a loser' ^^ that just made me laugh so hard:p thanks for making these amzing tutorials so entertaining!

  14. kinotarantino1 Avatar

    Hi guys, there is a moment in which the ball stops bouncing and goes under the height or width and we loose the ball – do you know any best method to avoid this? Many thanks for any reply.

  15. imassassin124 Avatar

    That's awesome.
    Given github links are not working for me, so here is link i found
    https://github.com/shiffman/The-Nature-of-Code-Examples/blob/master/chp02_forces/NOC_2_1_forces/Mover.pde
    for Mover class in case some one interested in edge method. Thanks Dan 🙂

  16. Miles Tincknell Avatar

    Still continuing to be amazing.

  17. Kyo Heo Avatar

    if(loc.y > height)
    {
    vel.y*=-1;

    }

    why you didnt mention this on video.. 🙁

  18. Sterv Avatar

    What do you have for your edges method

Leave a Reply

Your email address will not be published. Required fields are marked *