Teaching myself C so I can build a particle simulation

Sdílet
Vložit
  • čas přidán 26. 06. 2024
  • Pezzza's video: • Writing a Physics Engi...
    Verlet Algorithm: www.algorithm-archive.org/con...
    Verlet Integration: physics.drexel.edu/~valliere/P...
    Icospheres: en.wikipedia.org/wiki/Geodesi...
    This codebase is a mess but if you're curious about the implementation or what libraries I used:
    C Version :: github.com/marichardson137/Ve...
    Python Version :: github.com/marichardson137/Py...
    Thanks for watching!
    Timestamps
    0:00 Introduction
    0:25 Python Version
    1:17 Verlet Integration
    2:37 Implementation
    3:29 Collisions
    4:17 Issues
    4:55 Optimization 1
    5:43 Optimization 2
    6:45 Optimization 3
    7:45 Coloring Particles
    8:52 Linking Particles
    11:24 Outro
    Music sourced from Epidemic Sound
    Sonar - David Celeste
    Radiance - Amber Glow
    Watercolor Motion II - Trevor Kowalski
    A Gentle Pulse - Imprismed

Komentáře • 258

  • @gr4dience
    @gr4dience  Před měsícem +103

    Hi everyone! Glad to hear you're enjoying the video, it means a lot. I added the source code in the description for those who asked (it's kind of a mess). My semester just ended so I should have some time to work on another graphics project. Let me know what you guys wanna see below! - Cheers

    • @simonzanta1403
      @simonzanta1403 Před měsícem +3

      heyy, i really enjoyed your video about computer graphics. Im currently researching sources for my Bachelor Thesis from computer graphics and i would like to ask you, if you could share some insights on how you research topics. It would be really helpful, couse i have no idea where to find sources and mainly what to search for.

    • @gr4dience
      @gr4dience  Před měsícem +4

      @@simonzanta1403 Public code repositories were certainly my best friend during this project! If I ever needed inspiration for some feature or felt myself getting stuck, I would do a quick search on CZcams or Google for something similar and that was usually enough to get me through. Another tip is to try breaking down your research into smaller pieces that will be easier to source (ie. "OpenGL instance rendering" as opposed to "OpenGL particles"). Hope that helps!

    •  Před měsícem

      third

    • @vinayakk2745
      @vinayakk2745 Před měsícem +4

      hello there, really liked your video! I'm a first year computer science student, I would like to know more about what you do and how you got here, I'd love if you'd upload a video talking about yourself, your work and your journey, it would really help and inspire me! Thank you for this great video!

    • @hanya-chan454
      @hanya-chan454 Před měsícem

      i love the work, why dont u make gravity simulation using nueton's thurd law of motion, i tryied to do it in unity, it kinda works but somehow the particles after attracting to each other and colliding they start to repeal each other (using barn's hut algorithm , no error in my code) , maybe u can do a simulation and explain the optimization method u choose.

  • @PezzzasWork
    @PezzzasWork Před měsícem +117

    Super cool video! Always funny to see we all encounter the same bugs along the way :D

  • @Nipings
    @Nipings Před měsícem +240

    The editing in this video is incredible

    • @njorogekamau3820
      @njorogekamau3820 Před měsícem +1

      You can achieve the same using an open source python library called manim

  • @luce_9801
    @luce_9801 Před měsícem +171

    I know what I'm doing in summer now. Thanks for the inspiration!

    • @_Rie_
      @_Rie_ Před měsícem +1

      me too gonna start college in august so im gonna learn C and make this happen good luck to you too

    • @Randomperson-yf2fw
      @Randomperson-yf2fw Před 29 dny

      @@_Rie_Good luck! C is a tough language in the beginning, but it's so satisfying to use once you've conquered the main pitfalls.

  • @samuelcollier1764
    @samuelcollier1764 Před měsícem +17

    this was an awesome video! C is my favorite programming language and I love seeing graphics programming projects like these :)

  • @vasq
    @vasq Před měsícem +5

    This is pure art. Amazing work bro.

  • @yourkideliasontwitter
    @yourkideliasontwitter Před měsícem +3

    This is a great video, and it is surprisingly well edited! I am not interested at all in physics simulation but the way you explained it really made me start paying attention and it was interesting how you used each optimisation technique to achieve even better results!

  • @samir_buch
    @samir_buch Před měsícem +46

    This is super impressive! Casually glossing over the fact that you taught yourself *not just C* but also how to render things with openGL is no small feat. Your in-depth knowledge of particle simulation is also pretty impressive, requiring at the very least knowledge of relatively advanced calculus and physics. And, on top of all of that, this video was very well written and edited. Overall great job, keep it up!

  • @avion85
    @avion85 Před měsícem +4

    Good luck for your success on yt. We need more content like this.

  • @QuarzleTheMinecrafter
    @QuarzleTheMinecrafter Před měsícem +5

    Yay another channel with my favourite type of content

  • @jonathan2847
    @jonathan2847 Před měsícem +3

    Engineers make a small number of good CZcams videos then dip back into the void to do their job. This is the good shit.

  • @stone8684
    @stone8684 Před měsícem +1

    dude, you're so incredible. I'd like to see more videos. keep doing them :3

  • @hendersonvirtual
    @hendersonvirtual Před měsícem +1

    Amazing, can’t wait to see more videos!

  • @ticusism
    @ticusism Před měsícem

    Awesome! Thanks for sharing your journey.

  • @wojciechkalinowski3827
    @wojciechkalinowski3827 Před měsícem +1

    Very nicely done! I like that you said what you did and kept it rather high level for the video. Whereas, if needed, and if you haven't already, then you can make a more detailed video for the code and maths. Great paste and keep at it!!

  • @aleksaggor
    @aleksaggor Před 25 dny

    Mesmerizing! You did a fantasic job with this program and video, keep it up :)

  • @evanbarnes9984
    @evanbarnes9984 Před měsícem +2

    Instantly subscribed! My god this is good.

  • @bigwalrosswalross3356
    @bigwalrosswalross3356 Před měsícem +15

    Another awesome programmer I have to subscribe xD
    Great work

  • @giorgito24
    @giorgito24 Před měsícem +1

    Absolutely stunning, more videos using C please😮

  • @space-yg
    @space-yg Před měsícem +2

    Yoooooo amazing video!! I learned so much from it

  • @lbgonpokeit
    @lbgonpokeit Před měsícem

    Awesome video, Man I could watch this stuff all day 😅

  • @youknowwhatlol6628
    @youknowwhatlol6628 Před měsícem +7

    hello. i am a beginner in all those things and have just found this channel....can't say how grateful I am to you. You, my friend, are an inspiration. You are Knowledge. You are Greatness. You hold the Power.
    Thank you so much. Thanks. Would like to see more of these simluations, math-physics-chemistry-related programs and such.
    Thank you.

  • @pyrusspangj
    @pyrusspangj Před 23 dny

    Gradience, this video is absolutely astonishing. Putting aside the great editing and video structure, the flow of your story and the way you tell it is both fascinating, and so intriguing. I adore computer science as a whole, and this is possibly one of my all time favorite videos now. What a masterpiece you've made. Subscribed, and hope to see more of what you do! :)

  • @mattywlion5174
    @mattywlion5174 Před měsícem

    Man it's a fantastic video, it's just great, love this

  • @arthurmac2511
    @arthurmac2511 Před 19 hodinami

    Now i have another reason to keep studying. You're an inspiration for me :D.

  • @thewholeworldblurred
    @thewholeworldblurred Před měsícem +38

    I clicked because of C!

  • @kiri9979
    @kiri9979 Před měsícem +1

    this video is amazing
    it feels like it's been made by a channel with at least a few hundred thousand subs
    keep it up !!

  • @user-qe6rh2qq9z
    @user-qe6rh2qq9z Před měsícem

    Very cool and informative video. Thanks for the effort.

  • @sirjersey
    @sirjersey Před měsícem +1

    Amazing Video! Definitley learned something new :)

  • @agaveboy
    @agaveboy Před měsícem +2

    that's great c code if you've really just learned it! good job

  • @ArmanNadjarian
    @ArmanNadjarian Před měsícem +1

    Fantastic work!

  • @eduardomarinho1482
    @eduardomarinho1482 Před měsícem

    Great video and very interesting project, will try to do it on my own. Also, I’m impressed for the quality of the video!

  • @cobrascolar
    @cobrascolar Před měsícem +3

    This channel is going to be massive

  • @lel7531
    @lel7531 Před měsícem +1

    Very cool video, top notch editing

  • @futuremapper_
    @futuremapper_ Před měsícem +2

    Love this!

  • @dennischen2922
    @dennischen2922 Před měsícem

    This is such an awesome project! Glad to see a fellow NC State student doing cool things!

  • @mohammadalaaelghamry8010

    Great video, thank you for sharing.

  • @waffles6555
    @waffles6555 Před měsícem

    I took a graduate level numerical methods course (my prof contributed to some popular CFD software) and it was very cool to see the different algorithms used. Great job !

  • @ArunKumar-zd4ue
    @ArunKumar-zd4ue Před měsícem +2

    this is a great video mate. this video remainds me of sabastian lague's videos. when ever i have thoughts about why i chose programming as a career i think of these kind of videos which boost my happiness and i say to myself that this is why i chose programming as a career to build cool stuffs.
    thanks mate. Great job !!

  • @skyt-csgo376
    @skyt-csgo376 Před měsícem +1

    Awsome work!

  • @DwellerLord
    @DwellerLord Před měsícem

    This is the best video I've seen all year

  • @chairlesscrocodile
    @chairlesscrocodile Před měsícem +3

    Great video!

  • @Mia-tk7dz
    @Mia-tk7dz Před měsícem +1

    love the video! good stuff

  • @alessandroserra885
    @alessandroserra885 Před měsícem +1

    That's simply amazing

  • @dylancode
    @dylancode Před 28 dny

    The new Sebastian Lague!
    Excellent video!

  • @MarrisaL-bs2ch
    @MarrisaL-bs2ch Před 7 dny

    subbed and notified so I can view more of your awesome project.

  • @3dgar7eandro
    @3dgar7eandro Před měsícem +2

    Cool Bro!

  • @p3ntag01
    @p3ntag01 Před 18 dny

    Nice Video Dude !

  • @drakeolejniczak2357
    @drakeolejniczak2357 Před měsícem +1

    That was awesome! My favorite part was when you found the linear algebra text and got your change of basis on.

  • @shuraosipov
    @shuraosipov Před měsícem +1

    Good job, man!

  • @Green-Code
    @Green-Code Před měsícem +1

    Great video! Keep it up!

  • @Sirepicwin
    @Sirepicwin Před měsícem

    I literally just stumbled on this video, amazing and very fun to watch. Made want to actually learn C and take a break from JS for while lol

  • @romeoxxiv
    @romeoxxiv Před měsícem +1

    Very interesting, thank you!

  • @megalos2030
    @megalos2030 Před měsícem +3

    Very good video !

  • @philipmichel-dv4gk
    @philipmichel-dv4gk Před měsícem

    really beautiful video . i can now see the importance o mathemetics in programming

  • @mathiasensimon
    @mathiasensimon Před měsícem +1

    Cant wait for more videos😊

  • @prateek3167
    @prateek3167 Před měsícem

    great work

  • @Raskoll
    @Raskoll Před měsícem +1

    Excellent video

  • @jahaynes256
    @jahaynes256 Před měsícem

    I have had this as a future project in my mind for years. I never went to third dimension due to the fear of linear algebra. This is really impressive and inspirational. Thanks for sharing.

  • @the_speedy_dog6808
    @the_speedy_dog6808 Před měsícem +1

    this was amazing :)

  • @blvnktek
    @blvnktek Před měsícem +1

    You got my sub sir!

  • @Alexander-pk1tu
    @Alexander-pk1tu Před měsícem

    Good work man!!

  • @ii7mdj_353
    @ii7mdj_353 Před 21 dnem

    Awesome bro 🫡

  • @antonpkf
    @antonpkf Před měsícem

    good job b!

  • @charliechimp6917
    @charliechimp6917 Před měsícem +1

    Mesmerising

  • @yousiftop7605
    @yousiftop7605 Před měsícem +1

    very enjoyable video

  • @kspv2806
    @kspv2806 Před 7 dny

    Amazing 😍

  • @Gaiuscassius565
    @Gaiuscassius565 Před měsícem

    super cool job. Very inspiring i wish i could do something like this

  • @m3tazodeh66
    @m3tazodeh66 Před měsícem

    This is soo cool

  • @nordmu
    @nordmu Před měsícem

    amazing video

  • @shis10
    @shis10 Před měsícem

    Amazing 😮

  • @Hakkyou1
    @Hakkyou1 Před měsícem +4

    Very nice video ! You might want to also look at fluid simulation using particle called Smoothed Particle Hydrodynamics. Basically you replace the collision algorithm with a constraint on the density modulated by a kernel. It sound bad like this but you already did 90% of the work there. Keep up the good work ! See you next video.

  • @Wannabetolkien
    @Wannabetolkien Před měsícem

    Amazing Work ! Post more content.❤

  • @aakkii5271
    @aakkii5271 Před měsícem +1

    Great channel potential, subbed

  • @serhiiko7141
    @serhiiko7141 Před měsícem +1

    this video deserves much more than 2.7 k views

  • @rgel3762
    @rgel3762 Před měsícem

    Just what I was looking for

  • @uphomes12
    @uphomes12 Před 19 dny

    so that face pull in Mario 64 is a masterpiece of my childhood.

  • @Codrootbeyond
    @Codrootbeyond Před měsícem +1

    Great video

  • @bonekazz-8441
    @bonekazz-8441 Před měsícem

    thats so cool bro

  • @Revvol93
    @Revvol93 Před měsícem

    love it!

  • @ronald1851
    @ronald1851 Před měsícem +1

    awesome possum my guy

  • @osalem192
    @osalem192 Před měsícem

    A new Sebastian Lague!
    Keep going!

  • @Charky32
    @Charky32 Před měsícem

    its amazing

  • @Ace-fkubar
    @Ace-fkubar Před měsícem

    Really Enjoyed the video
    Very cool!
    I had the same vibe from you as 3Blue1Brown.

  • @Spencersstory
    @Spencersstory Před měsícem

    Sick good work man. Makes me remember why I chose computer science

  • @abdala3475
    @abdala3475 Před měsícem +65

    And here I am, struggling with a simple pyramid c code

    • @Pepegalord
      @Pepegalord Před měsícem +2

      Feel you

    • @MasterofBeats
      @MasterofBeats Před měsícem +1

      me fr fr

    • @wardingward4884
      @wardingward4884 Před měsícem +2

      Its okay, I'll get harder in arrays, and pointers 💀💀

    • @nad.99
      @nad.99 Před měsícem

      انا

    • @nad.99
      @nad.99 Před měsícem

      @@wardingward4884 linked lists is where I gave up willingly

  • @yoyo3257
    @yoyo3257 Před dnem

    When you realise that math class was not just a class
    Fantastic good job

  • @gedaliakoehler6992
    @gedaliakoehler6992 Před měsícem +1

    Great video, graphics engine, and physics engine :)

  • @Stylpe
    @Stylpe Před měsícem +1

    This is going to be a fantastic springboard for my own physics sim ideas! Starred, will fork when this makes it to the top of my project queue (it's about number 3 I'd say, but full disclosure, it might also never happen 😛)

  • @user-zj3dd4yb3f
    @user-zj3dd4yb3f Před měsícem +4

    Now I want to do this by myself.

  • @css2165
    @css2165 Před měsícem

    I hope this isn't going to be one of those channels that uploads 3 fire videos and then disappears for years
    Keep going bro 💯

  • @barkaouiaziz8926
    @barkaouiaziz8926 Před měsícem

    great content keep going

  • @omarwagmes
    @omarwagmes Před měsícem

    we need the long version of this please

  • @past_life639
    @past_life639 Před 22 dny

    Very good

  • @josh-richards
    @josh-richards Před 11 dny

    Nice!

  • @ed7590
    @ed7590 Před měsícem +1

    Inspiring, makes me want to drop all my JS projects and return to low level.

  • @georgiosdoumas2446
    @georgiosdoumas2446 Před měsícem +1

    I have studied physics in 1991-1995, and I had a semester on Fortran in the university. Then at 2004 I learned a little C, and the following years I was slowly reading a few books on C and C++ (mainly I was reading stuff about networks and linux for my jobs) . Since late 2023 I became a junior C++ developer. A few weeks I started learning OpenGL (I can give suggestions to who ever is interested). But I know that I am nowhere near the level to make such simulations! I am so impressed that you are still a university student and can produce those videos!

  • @PridedBacon
    @PridedBacon Před měsícem +166

    Can you pls open-source this

    • @oldgold8247
      @oldgold8247 Před měsícem +4

      In the description now

    • @whannabi
      @whannabi Před 28 dny +2

      Gotta pay for all the spilled sweat

  • @justins7796
    @justins7796 Před měsícem

    dang you're a legend if you used a physical Linear Algebra textbook to solve your problems. Subbed!

  • @nad.99
    @nad.99 Před měsícem

    Halfway through this video i feel kms cuz I don’t see myself getting this good anytime soon. Man you’re awesome.

    • @kylerchen2385
      @kylerchen2385 Před 9 dny

      naw bruh you can get this good - its possible for any of us. if u wanna build something like this just fuckin believe in urself dawg u can do it. do that, and videos like this produce nothing but inspiration and excitement for your future work :)

    • @rideaux8533
      @rideaux8533 Před 7 dny

      @@kylerchen2385 its not possible for everyone, but we cant know without trying