   Point-Based Physics Tutorials
  Hello all.UPDATES: The First Tutorial: Basic Physics StuffThe Second Tutorial: Constraints and SpringsThe Third Tutorial: Fluids in GamesI have recently begun a series of tutorials on point-based physics programming for beginners, writing together with Grant Kot (kotsoft on youtube/gmail). We are in general trying to give good explanations to the physics underlying things and to give very easy-to-read code as examples.Our first tutorial is out, covering very simple concepts in forces. (Its implementation is shared with the same great technique as Thomas Jakobsen's paper and talk on "Advanced Character Physics" which I am sure many of you know) The second tutorial, in writing at the moment, is a introduction to the concept of spring forces and iterative constraint solving, their implementation in Verlet, and will build a small room with stacking circles (Or spheres as a very simple extension). The third tutorial will cover one of my favorite topics: fluid simulation using SPH. We will cover the equation splitting concepts, ideas behind Navier-Stokes, and hopefully nail down a great explanation to the implementation.I hope this isn't seen as some ridiculous advertisement. We really want to create a series geared toward developers of real-time applications like games, so I thought I would try to give back to this great community from whom I have learned much. I hope you enjoy!This is the first tutorial. Any critiques are welcome.The First tutorial[Edited by - brandonpelfrey on June 7, 2009 11:26:05 AM]
  Neat tutorial, good introduction to the topic and I liked the hands-on approach, definitely better than all theory, or all code with some comments thrown in. Maybe a short discussion on calculating proper timesteps wouldn't have hurt, since that's the only thing missing from it for someone to be able to incorporate some basic physics simulation into their own project based on the tutorial. But I guess there's plenty of material available on that topic already.This one didn't contain too much news for me personally, but I'm looking forward to the fluid simulation tutorial, was planning on learning about that eventually, and a tutorial will give me a nice jumpstart :)Keep up the good work!   ;  This sounds very promising! Will read the tutorial tonight...   ;  Wow! For once, a tutorial written by someone who knows what they're talking about. Might be a little densely mathy for beginners (in particular, assuming knowledge of the gradient operator), but that's a minor point. Great work, keep it up!   ;  The second tutorial is now complete! We go over the concepts of springs and constraints with projection, weighting by mass, and give a little hint to mesh-based deformation that will be discussed in the fourth tutorial. I hope you enjoy this! The next (third) tutorial will be on fluid motion via Smoothed Particle Hydrodynamics.http://blog.brandonpelfrey.com/?p=242A small video of the product of this tutorial is available at ;  On tutorial 101 I have a few ideas for improvement...(1) In the numerical integration introduction it says:"A system’s “state” is a collection of information that describes all of the positions and other variables that you would need in order to find the positions and others in the next frame."I think you should point out that all we nedd to know about a particle to calculate the next frame are its state vectors, ie. the position and velocity vectors. I mean what "other variables" would there be? :-)(2) I really think you should edit out the "nerdy explanation on what forces are". It doesn't really add anything to the tutorial, and it will only confuse the math/physics novice, which you are really trying to help.(3) When writing physics tutorials for programmers it's often a good idea to put  small code samles into the text every time you've introduced a new concept, just to show what all the math thats been babbled on about actually looks like when implemented in a program. This way the physics novice programmer will say "ah ok, thats what he means!" and move on in the text instead of getting confused.Cheers,Mike   ;Quote:Original post by h4tt3nOn tutorial 101 I have a few ideas for improvement...(1) In the numerical integration introduction it says:"A system’s “state” is a collection of information that describes all of the positions and other variables that you would need in order to find the positions and others in the next frame."I think you should point out that all we nedd to know about a particle to calculate the next frame are its state vectors, ie. the position and velocity vectors. I mean what "other variables" would there be? :-)(2) I really think you should edit out the "nerdy explanation on what forces are". It doesn't really add anything to the tutorial, and it will only confuse the math/physics novice, which you are really trying to help.(3) When writing physics tutorials for programmers it's often a good idea to put  small code samles into the text every time you've introduced a new concept, just to show what all the math thats been babbled on about actually looks like when implemented in a program. This way the physics novice programmer will say "ah ok, thats what he means!" and move on in the text instead of getting confused.Cheers,MikeThanks Mike for the input =] In the simple point physics stuff right now, you're absolutely spot on: we do only need position and velocity with our 2nd order integrator. Later on we will need more information to define state, especially when it spreads onto multiple grids at different resolutions and when we need the stress-strain information of the current frame to compute the next. But you're right. For now, that's all we need and maybe it is a little bit confusing. The nerdy explanation stuff has to stay. One of the reasons I had to write these things is the fact that no other tutorials gave any basis for why things worked, even if you wanted to know. The reasons tend to be complicated, but they're there if you want to know just in case ;] Also, if people really want to make something new, they need to know at least a little dab of the theory so that they can correctly branch into something new. Just a personal thought, really. On the subject of code, I totally agree. I'm looking for a good plugin right now to handle the syntax and all while not being a kludge of outdated &#106avascripts and other do-dads. I hope you check out the fluid tutorial coming soon. It's the reason I really started all of this. These first two tutorials are more or less a little bit of fundamental information before we delve into the (admittedly complicated) topic of fluid simulation for games.Thanks again for the response and critiques!   ;  Glad you liked the input. You bet I'll read the sph tutorial - been looking for a tutorial on that topic for some time now!Cheers,Mike   ;  Looks pretty wicked.As for the editing out of the "nerdy stuff", here's an alternative - just make the text grey-ish, so that it's obvious that it's non-essential to a copy paster :)   ;Quote:Original post by toriLooks pretty wicked.As for the editing out of the "nerdy stuff", here's an alternative - just make the text grey-ish, so that it's obvious that it's non-essential to a copy paster :)If I could make it one of those expandable accordion things... How about that? It would just say "Nerdy Explanation" and you can click to get the lowdown.   