No video

01 - Writing a physics simulation in 10 minutes

  Рет қаралды 26,724

Ten Minute Physics

Ten Minute Physics

2 жыл бұрын

For the source html code and all other tutorials see matthias-research.github.io/p...
This is an introduction to my channel "Ten Minute Physics" in which I present methods to simulate rigid objects, soft objects, cloth, water, sand and more with just a few lines of Javascript code inside a self-contained HTML document.

Пікірлер: 43
@voxelltech
@voxelltech 2 жыл бұрын
This is awesome! Thank you for all your work on the research! I am really excited to follow along this series!
@austin-maddison
@austin-maddison Жыл бұрын
This has been such an invaluable resource for me as a student and an aspiring graphics engineer. Thank you so much!
@adlbroun
@adlbroun 2 жыл бұрын
This is fantastic. When I was first getting into programming over 20 years ago I remember implementing a bouncing ball simulation like this in Excel VBA (best dev environment available on the computers where I was working!). I was blown away when implementing the equations I'd learnt in high school maths that I got such cool results for this and then later a toy planetary motion simulator. I think this is a great way of teaching people how to implement physics simulators, and also to get them interested in programming in general. Looking forward to following along with the rest of the series. :-)
@bvds2007
@bvds2007 Жыл бұрын
This is a great resource. It is great that you are using straightforward javascript without all sorts of framework-related code which detracts from the main purpose of your code. Thank you.
@mihirmanna1488
@mihirmanna1488 Жыл бұрын
As someone who's been interested in coding physics simulations but never really known where to start, this is truly amazing. Everything was explained so well and I can't wait to keep going! Probably the fastest I've ever subscribed to a channel haha
@franciscotrigo9656
@franciscotrigo9656 Жыл бұрын
I'm surprised how little overhead requires these simulations using HTML and Javascrip. Thank you, Matthias, for opening my eyes!
@GoogleUser-ee8ro
@GoogleUser-ee8ro Жыл бұрын
I can only imagine all the kids on youtube who are learning physics and programming are going to be crazy about this channel channel.
@cesarmello2006
@cesarmello2006 Жыл бұрын
Congrats for the great work! Thank you so much for creating this channel.
@thebirdhasbeencharged
@thebirdhasbeencharged 2 жыл бұрын
Just stumbled on your channel, fantastic stuff mate. Thank you.
@tiago08ci
@tiago08ci Жыл бұрын
So cool! Thanks a lot, you gained a subscriber who recently finished a masters degree in numerical analysis! Cheers!
@LogicEu
@LogicEu 2 жыл бұрын
Hey! Thank you for doing this! It's incredibly educative
@stevenspmd
@stevenspmd Жыл бұрын
Wow, I went back to university to retake some math classes because I'm interested in this stuff! Super cool!
@guilhermejofili
@guilhermejofili Жыл бұрын
Wow! Great. Thanks very much. Lots of fun and learning. ❤
@sean_vikoren
@sean_vikoren 2 жыл бұрын
Thank you for your generosity!
@TenMinutePhysics
@TenMinutePhysics 2 жыл бұрын
My pleasure!
@nyscersul42
@nyscersul42 9 ай бұрын
You've done very well in being clear. :)
@sinam1951
@sinam1951 Жыл бұрын
Excellent job! Thank you for making this chanel
@natteraksadawan4772
@natteraksadawan4772 9 ай бұрын
Thanks, This is what I am looking for!!!
@jmauriciou
@jmauriciou Жыл бұрын
This is amazing content
@nevil6147
@nevil6147 9 ай бұрын
Mega cool dass dr müeh geh hesch mit video + demo code + sogar no pdf presentation. Echt vorbildliche approach für lehrinhalt
@MsJeffreyF
@MsJeffreyF Жыл бұрын
I think because of the way we are doing reflection when bouncing off the ground we are losing velocity and the ball will get lower and lower. I think it's because of this because when it hits the ground, it will be less than 0 by a variable amount, but we aren't taking that into account in the position
@444haluk
@444haluk 2 жыл бұрын
My current idol
@djaccount5458
@djaccount5458 Жыл бұрын
Super!
@JoshyLats
@JoshyLats 2 жыл бұрын
Thanks!
@jayanth9661
@jayanth9661 2 жыл бұрын
Hey , I really liked your channel! Could you please do video on fluid simulation using SPH ?
@captainpissof9632
@captainpissof9632 Жыл бұрын
why doesn't this dude have like 10mil subscribers?
@atomictraveller
@atomictraveller Жыл бұрын
it's a question that i personally find easier to answer after having ma5ons crap all over my life. hth.
@masterblaster3483
@masterblaster3483 2 жыл бұрын
Hi Matthias, I've been following you for a long time and as always I'm impressed with the quality and distinction of your work. Your openness in sharing your knowledge is admirable. If I may ask, at 10:51 you said that using higher order integration methods would not yeld notable improvements "when collisions occur". Could you please expand on this particular point? Are you suggesting that symplectic Euler is superior to leapfrog integration (2nd order) in case of particle-particle collisions? Is there a real problem in using other integration schemes (e.g. Runge-Kutta et similia) when dealing with collisions apart from the fact that acceleration would never be constant during dt? Thanks in advance for your response.
@matthimf
@matthimf 2 жыл бұрын
Hi, nice to hear that you like my work. Higher order schemes extrapolate the trajectories into the future. However, extrapolations become invalid when collisions occur.
@masterblaster3483
@masterblaster3483 2 жыл бұрын
Hi Matthias, thank you for your prompt reply. In the 2018 work "An adaptive timestepping algorithm for particle time integration in coupled CFD-DEM simulations", Hariswaran Sitaraman and Ray Grout, a Velocity Verlet second order integration scheme is used in conjunction with a variable time step approach for local domains. This puzzles me, because the answer you have given me makes perfect logical sense. Nonetheless Verlet integration schemes are often used to integrate Newton's equations of motion. From Wikipedia: "The Verlet integrator provides good numerical stability, as well as other properties that are important in physical systems such as time reversibility and preservation of the symplectic form on phase space, at no significant additional computational cost over the simple Euler method." Your answer, which I consider of utmost relevance, seems to suggest that higher order integration schemes only apply in case of hard-sphere contact model and methodology, typical of molecular dynamics or the Discrete Element Method. Could you please confirm or negate this latter assumption? Best regards, Stefano.
@ThankYouESM
@ThankYouESM 2 жыл бұрын
I've been trying to learn Javascript for over 3 years... then completely gave up... then a friend of mine introduced me to python which took me 4 months to learn... whereas I had fun quickly creating a whole lot of fun projects while hoping the processing speed of Python would become more than fast to make AAA 3D games... then after 5 years waiting... decided to give Javascript another chance, but... couldn't seem to progress any further... it's like I need to do 5000 times more work to finally finish a project. Had recently thought of making a project that would convert Python scripts to become purely Javascript much as possible, so... I hope to start this journey from here.
@Erik_Caballero
@Erik_Caballero Жыл бұрын
Have you considered using Julia? It reads a lot like Python but it's as fast as JavaScript for most applications.
@ThankYouESM
@ThankYouESM Жыл бұрын
@@Erik_Caballero I do very much thank you for that recommendation... it's just that I seem to have found the ultimate solution because of ChatGPT this December to instantly make awesome Javascript applications by simply converting Tkinter scripts over which it figures out how to optimize. Also... I got it to design what Tkinter version of Blockly, but looks like just a professional text editor until I click near the front of the line that expands it to become the error-resistant template even providing a long list of what it predicts could be what I want it to write. However... because of the time restraint and being new as it gets... I haven't really gotten around to testing it all out... just be gathering scripts galore, then asking the ChatGPT where to place in a skeletal structure as not to overwhelm the network.
@sivabalan_m
@sivabalan_m Жыл бұрын
should the delta time dt be equal to the frame interval of the application? But here you are manually giving a value to dt. is this really correct approach?
@marcosdanieltorres7253
@marcosdanieltorres7253 3 ай бұрын
If im not mistaking is because canvas tries to run at 60fps by default and 1 / 60 is 0.016 which is how much one frame takes. He is assuming it will run at 60fps given that the calculation is simple
@sivabalan_m
@sivabalan_m 3 ай бұрын
@@marcosdanieltorres7253 Thanks. I understand.
@vincenzopanella2705
@vincenzopanella2705 2 жыл бұрын
What I have found difficult in physics simulation is not integration itself, but dealing with collisions using complex spahes. I'd like to know your opinion on new methods implementing signed distance fields using the gpus, do you think that this might be considered a viable method for future physics engines ?
@voxelltech
@voxelltech 2 жыл бұрын
From my little experience in physics simulation, SDF works really well for static objects.
@User-jr7vf
@User-jr7vf Жыл бұрын
It would be very helpful if you make a video explaining step by step what is needed to write and run simulations, such as: (1) download Microsoft Visual Studio (2) how to write the actual code (3) how to compile it.
@user-px5pj7ux5k
@user-px5pj7ux5k 11 ай бұрын
Stingy
@zaidalghazzi8699
@zaidalghazzi8699 Ай бұрын
you area crazy one cuz you act like no air force at all and that is not real, so all code is useless.
@procactus9109
@procactus9109 Жыл бұрын
JavaScript.. that shouldn't even exist. Garbage
@TenMinutePhysics
@TenMinutePhysics Жыл бұрын
I use c++ for work because its the fastest. Without the fancy stuff JavaScript looks exactly like c++ and the amazing thing is, it's almost as fast look at the demos! The JIT is a masterpiece!
02 - Writing a VR physics simulation in 10 minutes
8:46
Ten Minute Physics
Рет қаралды 7 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 52 МЛН
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 14 МЛН
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 20 МЛН
17 - How to write an Eulerian fluid simulator with 200 lines of code.
12:05
Ten Minute Physics
Рет қаралды 290 М.
Soft Body Physics Explained
10:47
Gonkee
Рет қаралды 532 М.
Learn To Code Like a GENIUS and Not Waste Time
9:41
The Coding Sloth
Рет қаралды 1,4 МЛН
Designing a Physics Engine in 5 minutes
7:37
Winterdev
Рет қаралды 152 М.
12 VS Code Extensions to INCREASE Productivity 2024
27:13
Devression
Рет қаралды 624 М.
How Well Can DeepMind's AI Learn Physics? ⚛
7:18
Two Minute Papers
Рет қаралды 1,6 МЛН
Building a Physics Engine with C++ and Simulating Machines
11:23
AngeTheGreat
Рет қаралды 689 М.
18 - How to write a FLIP water / fluid simulation running in your browser
12:20