How to make a small physics engine ?

Started by
11 comments, last by Mach2 18 years, 5 months ago
I want to write a small physics engine as part of learning exercise. I had physics and mathematics during engineering but have no idea of the interfacing between physics and graphics in games and the practical approach inside the physics engine. I figured out a couple of books namely, 1. Real-Time Collision Detection by Christer Ericson 2. Game Physics by David H. Eberly 3. Methods of Mathematical Physics (Paperback) by R. Courant, D. Hilbert 4. Partial Differential Equations of Applied Mathematics, 2nd Edition by Erich Zauderer, Erich Zauderer I heard they are great, must have, worth the money kinda books but since the money involved aint so small for me i want to make sure if they are useful for starters and aimed towards writing engines. Can you please tell me 1. Which are required, which aren't ? 2. What else should I add to my cart to make it look like a comprehensive course? (My dream book will be "How To Write Your Own Physics Engine in 6 Months") I am working as a software engineer for the last 2 years and i have decided to go into the physics part of games mainly for my interest in these areas. Hope some of you could relate to my situation and give me a good advice on this. Thanks!
Advertisement
I haven't looked at that books, but I recommend you to read 'Physically Based Modelling' course from Witkins and Baraff. You can get some insights to design your physics engine.
If you want a relatively small physics engine, it's a good starting point.
Graphics system draws something at somewhere, it doesn't care if scene is static or dynamic, and physics system only share that somewhere and keeps updated with the stimulus it gets.
The interface could be to gather the spatial information (state of object and it's physical properties) from the scene and update before rendering. Then you have to expose an interface to apply forces and such to the system.
YengaMatiC for the people[Pandora's Box project]
Of those you list, I would pick Eberly's book first since it covers practical physics simulation in games. Christer's book is fabulous, but is more about just collision detection. Recommended highly (and I can't stress that enough), but more specialized.

I would not personally want to look at the other two books. Good for theoretical understanding (maybe, they could just be crap textbooks too), but not particularly helpful for practical implementation of numerical physics.

That said, there is another book that I might recommend more than what you have listed here. That book is Eberly's "3D Game Engine Architecture." This is an extremely nice book that talks about good game engine design. The discussion is based on Eberly's own engine, which is very, very well thought out and implemented. He talks about physics in this book as well, though in less detail than the game physics book. What is nice in this book is that he talks about how the engine fits together as a whole, which is helpful for knowing how physics and graphics connect.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Quote:Original post by grhodes_at_work
That said, there is another book that I might recommend more than what you have listed here. That book is Eberly's "3D Game Engine Architecture." This is an extremely nice book that talks about good game engine design. The discussion is based on Eberly's own engine, which is very, very well thought out and implemented. He talks about physics in this book as well, though in less detail than the game physics book. What is nice in this book is that he talks about how the engine fits together as a whole, which is helpful for knowing how physics and graphics connect.

Seconded. I bought this book about a month ago and it's been one of the best game-related book purchases I've ever made.
Thank you all for your inputs. Confirmed, my list sure needs a second look.
Maybe look at

Physics Based Animation (Graphics Series)
by Kenny Erleben, Jon Sporring, Knud Henriksen, Henrik Dohlmann

though I haven't seen it myself
I'm studying Eberly's book, I find it heavy on the maths (he has a nice revision section at the back), but it's a very good book. I'd reccomend it as a beginner in programming physics myself.
I wouldn't start by writing a physics engine, instead write some simple physics demos.

e.g. modelling a pendulum, a double pendulum, a soliton, a spring...

All of these teach you the basic concepts of modelling a real world object and will help you explore the various methods and there accuracy and instabilities. So look at euler, leapfrog, RK2 and so forth.

I did a computational physics course as part of my degree and it increased my understanding of game engines as a consequence, the methods are basically the same.
Gameversity.com has a course on building a physics engine. It's start with simple point mass, collision detection, goes to rigid bodies, soft bodies (cloth simulation), and covers rag-doll physics.

The material is written as a book and you get one chapter of the book per week. The book itself is probably worth the price of the class. You also have access to the physics engine code (which you'll need to program some of it yourself).

Eventhough I had most of the books mentionned (which helped me get through the course) I found that taking the course is the only way that I could really force myself to go through all the material in such a short time period (12 weeks). When you have other students working at the same time on their own projects and you see their result, it motivates you to try and do even better.

Good luck!

Shadx
you can also take a look on this very good game physics articles:

http://www.gaffer.org/articles/

This topic is closed to new replies.

Advertisement