@Vitor m the dt is not needed because here « velocity » is in fact the distance traveled since the last update so it’s already equivalent to velocity * dt
Me after spending 4 hours of pure suffering to figure out the problem then figuring it out and being so proud of my self. Then moving both of my fingers up to see the comment section and realizing that the first comment is addressing the problem 😭😭😭😭😭😭😭😭😭. It's even worse when I realize that I have tests and that I should have spend that time studying 😭😭😭😭😭😭. Please edit the video to save people from suffering like that. Or maybe it's just me whose that stupid |(>_
Thank you! And thank you for your videos as well, I found your channel very recently and I really like what you are doing! it seems that we have common interests :)
My understanding of the code is currently too limited, but I will definitely learn and come back to this amazing video, I have always wanted to do things like that. Amazing work again Pezzza, wish you all the best.
How ?! It looks so easy to implement and the result is awesome ! Thank you so much, each of your videos is a bigger mindblowing for me than the previous one
I suspect this is just the art of having studied some mathematics (multivariable calculus and linear algebra is probably enough). With math knowledge you can just take the equation and implement it.
The colored circles at the end turning into your logo was pretty bad ass. How was it done though? Running the simulation to see where each object ends up then running the simulation again and coloring each object based on its final resting point?
@@themikek99 Possibly, but Verlet integration is lossy when you add collision handling, so it would have to be a different process in order to be reversible. I think Stylex may have the right idea there. The process is entirely deterministic, so with the same conditions you'll always get the same outcome. You could run the simulation once, take note of where each object ends up, then color them accordingly, and re-run the sim to get the logo.
He probably read the image data and the. assigned the objects for some of the pixels and then gave them the velocity to make them move in the right way.
You inspired me to learn C++ after fearing its complexity for months. I finally was able to learn C++ because of you. Please make more videos like this in the future. I enjoyed the teaching style and learned a lot. Keep up the great work man.
Thank you so much for your message, it is so cool to read ! I hope you will enjoy the possibilities that c++ offers! It’s a complex but very powerful language
This is really cool, I always learn something new watching your videos! Implementing collisions and constraints by simply updating positions and having an integration function that can figure out velocity/acceleration is powerfully clever. Great explanation at the beginning, and the surprise picture at the end was a nice touch. Looking forward to your next adventure :)
Wow! Incredible. I can't believe how elegantly and simply you set up the code for a complex-looking and incredible result. I also can't believe how you fit this into a 9min video. You're incredible.
It's amazing! You just taught me in less than 10 minutes what I wasn't able to learn on my own in weeks! Do you plan on uploading more videos like this in the future? It would be amazing to see how you deal with problems like tunnelling and static collision shapes
5:40 I was thinking the "perfect" solution to this would be, aside from sub-stepping, to add a bit of friction every time there is a collision, this would settle the objects quicker so they don't vibrate while stationary. Just multiply the vectors by 0.99 or something like that.
I loved the video and really respect this channel! if you do a version with continuous collision detection then there is nothing more to expect from you!
Bravo my friend, Bravo! An excellent look at the basic Velocity per frame physics engine and just how powerful circle collisions can be. I spent a moment trying to figure out why the velocity was updating before realising you were actually calculating it each step rather than keeping it persistent throughout. I'm going to play a little with the idea of calculating Velocity before applying motion to it, in 3D though since I work a lot on 3D character control systems and write the motion custom. This has been visually the nicest way to show the beauty of a physics engine.
@@PezzzasWork I do plenty of platformer gameplay systems, but usually keep velocity persistent rather than calculate immediately before applying the new step. Definitely something I want to try out, might end up making some cool stuff out of it too.
I find you right that moment and i am a software engineer in trainee... i can understand the code a bit and on the other hand i sit here and think, i know nothing about physics and simulations. Pretty mind blowing your work. This Bonus at the end.... HOW?? Thanks man, i cant stop to smile. :)
Your work is very impressive. Thanks for the video. It motivated me to implement this on the language I know the most, so I implemented it in Java. Finally after a couple of hours it worked fine. I implemented all the functions you demonstrated. Functions can be initiated from the menu. Additionally based on the chain example I implemented a rigid body. The last function will be the magic. You can open a picture and cut a part of it and that will appear as your logo did. I will share it as soon as it is done. So thanks again, nice job!
bro, this video is a masterpiece, my dream is to be a developer like you. i saw all your past and recent videos and every one of them are amazing! please, PLEASE keep the good work
Amazing! I've been trying to understand the programming behind physics and make my own 2D and 3D game engines. Visually appealing and informative video. Thanks. :)
I don't even know much about code, so this is already very helpful! And by helpful I mean I will probably keep rewatching this every time I want to do physics simulation.
The concept of Verlet integration is actually super cool IMO, because it means momentum changes from collisions/etc are handled more or less automatically.
lol... was gonna write so many questions in another video, asking how to get there... now I found this clip before I would have sent that long comment! This is a clip to start with, I guess. Thank you for enabling me to at least try. Subscribed! Maybe you link this video clip in the notifications of other stuff you uploaded!
This was fantastic. I loved the way you simply coded this complex looking problem. I was wondering what would it take if I wanted to add friction forces among particles.
I remember Kaze Emanuar talk about using ray casting to calculate collision in between frames, an alternative to sub steps but may not provide realistic physics... I don't really know.
Amazing video, I learned a lot from it. I just have a quick question : what software did you use to render the video ( like in the beginning when you explained the formula ). It looks like the 3blue 1brown animation software.
I can't understand how thing is being applied, but i loved it especially the bonus clip 🔥 I have to learn alot to achieve this, nevermind i will do that
Pezza this is great! I have made a couple of simple physics engines and most were kind of working but generally terrible, ill have to try out verlet integration! My main question is how the hell did you do the 'bonus' where the balls form your profile pic? Im guessing its like the constraint system but you base the color of the ball relative to its position?
I was literally trying to implement physics, then I though "wait a sec, Pezzza's Work as a video on that!" I'm surprised how well it works without even considering the forces between the objects or even their masses - it just moves the objects around based on an extremely simple set of rules.