Physics Simulations With Python and PyMunk

Sdílet
Vložit
  • čas přidán 28. 07. 2024
  • Welcome back to another video! In this video I am going to be introducing you to the module known as PyMunk and showing you that it is really easy to use and can do a ton of powerful things! I am going to show you a few demos and then go into a full tutorial where we actually build a project using PyMunk! I hope you enjoy!
    💻Thanks to Altium Designer for sponsoring this video. Checkout the best PCD design software on the market by signing up for a FREE trial here: www.altium.com/yt/techwithtim
    💻 ProgrammingExpert is the best platform to learn how to code and become a software engineer as fast as possible! Check it out here: programmingexpert.io/tim and use code "tim" for a discount!
    ⭐️ Timestamps ⭐️
    00:00:00 | PyMunk Demos
    00:03:39 | PyMunk Installation
    00:05:31 | Pygame Event Loop
    00:09:41 | Creating A Space
    00:12:00 | Drawing The Simulation
    00:16:16 | Creating A Circle
    00:22:23 | Creating Floors and Walls
    00:28:44 | Elasticity and Friction
    00:30:56 | Launching The Ball
    00:48:26 | Creating Obstacles To Hit
    00:52:52 | Creating A Swinging Pendulum
    ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
    👕 Merchandise: teespring.com/stores/tech-wit...
    📸 Instagram: / tech_with_tim
    📱 Twitter: / techwithtimm
    ⭐ Discord: / discord
    📝 LinkedIn: / tim-ruscica-82631b179
    🌎 Website: techwithtim.net
    📂 GitHub: github.com/techwithtim
    🔊 Podcast: anchor.fm/tech-with-tim
    🎬 My CZcams Gear: www.techwithtim.net/gear/
    💵 One-Time Donations: www.paypal.com/donate?hosted_...
    💰 Patreon: / techwithtim
    ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
    ⭐️ Tags ⭐️
    -Physics Simulations With Python and PyMunk
    -How to do Physics Simulation
    -Python
    -PyMunk
    -How to Use PyMunk
    ⭐️ Hashtags ⭐️
    #TechWithTim #PhysicsSimulations

Komentáře • 87

  • @dede-kw1jm
    @dede-kw1jm Před 2 lety +2

    It's a rare experience to watch such clear thinking. I also debugged the same problems as you before watching how you fixed them. Major difference in time but I'm happy I found the errors. Feeling very inspired, thanks Tim!

  • @SuperrrGoat
    @SuperrrGoat Před rokem +9

    You are absolutely amazing with this wide math pyhysics and programming knowledge. This aspects bringed together makes you fantastic programme. Thanks Tim

  • @leonardsmith9870
    @leonardsmith9870 Před 2 lety +75

    Can I use this to simulate my parents being proud of me?

  • @salarshahryari4843
    @salarshahryari4843 Před 2 lety +4

    I really enjoy these physics simulations... please do more... thanks

  • @eta9605
    @eta9605 Před 2 lety +4

    A video about creating a Lap Time Simulator (for a race car in a given circuit) in python would be interesting. These physics videos are cool.

  • @futurism010
    @futurism010 Před 2 lety +3

    Your videos are always TRUE! Love all contents you made...

  • @davidleaskhome
    @davidleaskhome Před 11 měsíci

    This video answered so many questions for me..thank you! There is not a lot of details on Pymunk (that are incomprehensible like the pymunk site) so more examples in a video would be fantastic. I am trying to build a pinball game from an image of a classic pinball game - that would demonstrate a lot of pymunk uses.

  • @kitgary
    @kitgary Před 2 lety +1

    This guy is absolutely a genius! I wish I had his skills at his age!

  • @philosopherPsy
    @philosopherPsy Před 8 měsíci

    The teacher's lectures are much more efficient and easier to understand than I( a beginner) read a whole book to study.
    Additionally, I checked by entering the code while watching the video.
    This is already the third time and has been done so cleanly without any errors. I followed along while watching your video about the solar system and Jupiter(Planet_Simulation with gravity effect) a few days ago.
    You inspire me really!
    Thank you for the great lecture!!

  • @Betabdullah
    @Betabdullah Před 2 lety +3

    Thanks for your videos

  • @Marcelo-yp9uz
    @Marcelo-yp9uz Před 2 lety

    Great as always

  • @ishaandugar7896
    @ishaandugar7896 Před 2 lety +7

    Tim, take this up as a challenge and perform fluid simulation using python!

  • @Biokompott
    @Biokompott Před 11 měsíci +1

    Thanks a lot! Really helpful tutorial!
    By the way: If somebody else run into "ValueError: cannot convert float NaN to integer" - I forgot to add mass to the structure. It seems you HAVE to set a mass here.

  • @GordonFreeman69
    @GordonFreeman69 Před rokem

    Nice, that was fun!

  • @learnwithkhensani24
    @learnwithkhensani24 Před 2 lety

    Great video Tim

  • @nicknguyen77
    @nicknguyen77 Před 15 dny

    This pymunk simulation is cool. Please do more.
    I'd like to learn enough to create an object that has mutiple connected points with an attached stylus that uses a fourier mathematical superposition formula (comple x plane) to draw a wave in normal space.

  • @excelwithmark
    @excelwithmark Před 2 lety

    This looks a great library. I thought when you rotated the camera everything would tip out

  • @shambles9043
    @shambles9043 Před 2 lety

    I'd love simulations that help visualize electromagnetism concepts! Things like electric/magnetic fields, propagating waves, solenoids, etc. Having simulations that can greatly help in visualizing these concepts!

  • @vmartme
    @vmartme Před 10 měsíci

    Thank you so much!

  • @envy_coppr2146
    @envy_coppr2146 Před rokem

    Great video Tim! I was just wondering, how do you get the orange overlay on your pygame window instead of white?

  • @YasinNabi
    @YasinNabi Před 2 lety +9

    a worth watching channel, very inspiring and thanks for sharing wonderful videos. Subbed and liked ! a fellow creator

  • @timeWaster76
    @timeWaster76 Před 5 měsíci

    Brilliant !

  • @moleexr639
    @moleexr639 Před 5 měsíci

    thansk Tim!

  • @klimentradoev7404
    @klimentradoev7404 Před rokem +1

    Amazing! I was just wondering if Pymunk / Pygame have any ability to deform an object under the exertion of a force / gravity? Would you make a video for this case?

  • @chanmeida1726
    @chanmeida1726 Před 2 lety +1

    @Tech With Tim

    Thanks for this video. Can you show us how to make the flipper game too?

  • @mastershooter64
    @mastershooter64 Před 2 lety +17

    i remember watching a pygame tutorial by tim, that's when i had the idea to make my own physics engine lol it was super fun, i haven't finished it yet, i just halted it

    • @kklol07
      @kklol07 Před rokem

      wow, where;s your project now

  • @crazed_weeb
    @crazed_weeb Před 2 lety

    finally a nice video

  • @educateyourselfdaily3196

    Hey Tim 👍❤️ highly expressed

  • @4B3K_
    @4B3K_ Před 2 lety

    Hi, nice video! I have a question, is there a way to add the rope when mouse down and when mouse up it's removed? I have tried to do it but it doesn't work...

  • @hirobumi6433
    @hirobumi6433 Před 2 lety

    Excellent tutorial! But I think we can skip the angle and distance calculation and just write :
    force_x = (press_pos1[0] - press_pos2[0]) * 100
    force_y = (press_pos1[1] - press_pos2[1]) * 100

  • @educateyourselfdaily3196

    Very updated Video 📸

  • @krystacassidy5684
    @krystacassidy5684 Před 2 lety

    So cool

  • @kartikchauhan2778
    @kartikchauhan2778 Před 2 lety +1

    Hello Tim, can you please make a ds algo series in python

  • @mentefria98
    @mentefria98 Před 2 lety +7

    I wish I had this video when I was studying physics at college

  • @krishgaikwad6108
    @krishgaikwad6108 Před 2 lety

    Cool, can u make a video about making a game using both pygame and pymunk

  • @devangkhatri4772
    @devangkhatri4772 Před 2 lety +3

    hello tim. so i did everything till 21:39 and when i ran the program , it crashed with the error "TypeError: 'Vec2d ;' object is not callable.
    i then tried to fix it in a few ways , changing names of the fnctions and then trying different values in the function and its still not fixed. I tried to look up on google too to try to see the documentation and understand whats going on but still had no idea. could you please help me fix it?

  • @mihajlomilovanovic003
    @mihajlomilovanovic003 Před 2 lety

    What do you think about programming language Pascal?

  • @moleexr639
    @moleexr639 Před 5 měsíci

    DId PyMunk can do destory ground effect, like a ball hit ground, the ground make a hole

  • @dianacampbell6336
    @dianacampbell6336 Před 2 lety

    What is the purpose of separately importing "pymunk.pygame_util" when "pymunk" is already imported?

  • @EW-mb1ih
    @EW-mb1ih Před 2 lety

    does it work in 3D space?

  • @kevinflanigan8653
    @kevinflanigan8653 Před rokem

    Fun!

  • @smallears1234
    @smallears1234 Před rokem

    Can this be used to create a model rocket simulator?

  • @Prodigy10044
    @Prodigy10044 Před 2 lety

    Is this something I can put on my resume?

  • @mml.01
    @mml.01 Před 2 lety +2

    Wow that's very useful I was worried about how to make this simulation and test an AI creature in it

  • @DevineDarkness
    @DevineDarkness Před 2 lety

    I get errors related to pylance. how do I resolve this?

  • @palantea1367
    @palantea1367 Před rokem

    28:56 you mean, you need conservation of momentum, not elasticity in order for the ball to "bounce".

  • @batman---
    @batman--- Před 2 lety

    should i download pycharm?

  • @ssholum
    @ssholum Před 2 lety

    35:00 I've seen enough Super Mario 64 speedrun videos to know where this is going.

  • @ANNGUYEN-cw7lw
    @ANNGUYEN-cw7lw Před 10 měsíci

    Hello instructor, I have a question to ask you are: I don't have good logic, I learn math is about just C, Can I become software developer without not good logic ?. Question 2: Can I get a software developer position in enterprise with an associate degree not bachelor degree at USA?

  • @matus1976
    @matus1976 Před 2 lety +1

    'The ball shoots the the wall when the velocity is too high because the frame update hasn't checked for the collision before the ball moves past the wall' ... Dang that sounds suspiciously alot like quantum tunneling lol.

  • @batista98854
    @batista98854 Před 2 lety +1

    Thank you from India.

  • @prakhardave.10
    @prakhardave.10 Před 2 lety

    can you provide full code?

  • @krishgaikwad6108
    @krishgaikwad6108 Před 2 lety +1

    More pymunk plssss

  • @TheEnderOcelot
    @TheEnderOcelot Před rokem +1

    21:35 'Circle' object has no attribute 'add' line 22 why???

  • @GoodLife-ru8di
    @GoodLife-ru8di Před 2 lety

    34:41 That's escape velocity lolz

  • @pranavsagar1886
    @pranavsagar1886 Před 2 lety

    Hey Tim. I purchased your Programming Expert yesterday and the website is not loading properly. I have tried everything. Deleting the cookies and tried to open it in an incognito window. But the Programming expert website is down for no reason. But the Algo Expert Website is working fine. Kindly check about the issue.

    • @bareMinimumExample
      @bareMinimumExample Před 2 lety

      Ive also purchased and its working fine for me. Tried just now. Both on pc and on android. I use chrome. I really like the course also, it was beyond expectation

    • @TechWithTim
      @TechWithTim  Před 2 lety

      Can u try on a different device? I don’t see any issue on my end as well. Please ensure you clear the cache (not just the cookies) and then reloading the website.

  • @akrzha
    @akrzha Před 2 lety

    I like writing code in sublime text, but don't know how to run/give input. Please tell me how to do that.

    • @TechWithTim
      @TechWithTim  Před 2 lety

      You can’t in sublime

    • @akrzha
      @akrzha Před 2 lety

      @@TechWithTim Then how are you running it in your's?

    • @krishgaikwad6108
      @krishgaikwad6108 Před 2 lety

      @@akrzha run code in Command line by giving the file name OR Look in the Tools menu for Build System and Build.

  • @mixshots1801
    @mixshots1801 Před 2 lety

    bro please make a video on automating whatsapp messages using python or any language

  • @ycombinator765
    @ycombinator765 Před rokem

    I love Python more now

  • @pravachanpatra4012
    @pravachanpatra4012 Před 2 lety +3

    Tim can you make DJANGO tutorials

    • @hypermeero4782
      @hypermeero4782 Před 2 lety

      He already did before

    • @pravachanpatra4012
      @pravachanpatra4012 Před 2 lety

      @@hypermeero4782 nah I’m talking about more Django apps, like a social media clone, chat application etc

  • @batman---
    @batman--- Před 2 lety

    what are you coding this on I've tried python IDEL and it didn't work

  • @davidsafro127
    @davidsafro127 Před 2 lety +2

    nice

  • @rishavmitra5732
    @rishavmitra5732 Před 2 lety

    Tim: does physics simulation
    Also Tim: doesn't know how to spell pendulum 😅

  • @tanmaypatel4152
    @tanmaypatel4152 Před 2 lety +1

    'THIS TUTORIAL IS NOT FOR BEGINNERS' *Proceeds to explain what a break statement is...*

  • @teamtubetv1465
    @teamtubetv1465 Před rokem

    37:32 watch the webcam its kinda sus

  • @marketalpha5426
    @marketalpha5426 Před 2 lety

    Breh... rolling balls kek

  • @clusterdriven
    @clusterdriven Před 2 lety

    beware long functions

  • @vinayakram5133
    @vinayakram5133 Před 2 lety +2

    Can u make numpy tutorial

  • @letsbuildit7640
    @letsbuildit7640 Před rokem

    i am noob in pygame 0-0

  • @shanno88
    @shanno88 Před 2 lety

    dude,code available?

  • @coolguy7160
    @coolguy7160 Před 2 lety

    Fourth!

  • @serbxn
    @serbxn Před 3 dny

    God bless chatgpt