Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


How to make a small physics engine ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 butterscotch   Members   -  Reputation: 122

Like
0Likes
Like

Posted 31 October 2005 - 01:22 AM

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!

Sponsor:

#2 YengaMatiC   Members   -  Reputation: 172

Like
0Likes
Like

Posted 31 October 2005 - 01:44 AM

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.

#3 grhodes_at_work   Moderators   -  Reputation: 1361

Like
0Likes
Like

Posted 01 November 2005 - 07:37 AM

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

#4 Zipster   Crossbones+   -  Reputation: 1040

Like
0Likes
Like

Posted 01 November 2005 - 12:25 PM

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.

#5 butterscotch   Members   -  Reputation: 122

Like
0Likes
Like

Posted 01 November 2005 - 10:10 PM

Thank you all for your inputs. Confirmed, my list sure needs a second look.

#6 MrRowl   Crossbones+   -  Reputation: 1691

Like
0Likes
Like

Posted 02 November 2005 - 12:04 AM

Maybe look at

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

though I haven't seen it myself

#7 PurpleAmethyst   Members   -  Reputation: 324

Like
0Likes
Like

Posted 02 November 2005 - 12:24 AM

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.

#8 Metorical   GDNet+   -  Reputation: 579

Like
0Likes
Like

Posted 02 November 2005 - 12:48 AM

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.

#9 Shadx   Members   -  Reputation: 202

Like
0Likes
Like

Posted 02 November 2005 - 05:47 AM

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

#10 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

0Likes

Posted 02 November 2005 - 06:01 AM

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

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


#11 scott_l_smith   Members   -  Reputation: 162

Like
0Likes
Like

Posted 02 November 2005 - 06:28 AM

I have most of the books that have been mentioned above, and have found each to be very useful. However, for the "this is my first physics engine" crowd, I would recommend "Physics for Game Developers". It is on of the O'Reilly books, and although I am not a huge fan of their code sample style, it is an excellent introduction to the needs of a basic physics engine. In saying this, I am guessing that you are interested in writing a basic rigid body simulation. Once you have graduated to that stage, I would recommend moving on to "Game Physics" and "Real-time Collision Detection" which are two of my favorites. I hope this helps.

Scott


#12 MrRowl   Crossbones+   -  Reputation: 1691

Like
0Likes
Like

Posted 02 November 2005 - 09:31 AM

Quote:
Original post by scott_l_smith
...However, for the "this is my first physics engine" crowd, I would recommend "Physics for Game Developers"....


I'd personally recommend not reading (or buying) that book - it's full of mistakes, bad explanations and the example code is badly written, buggy, and barely works etc etc... (using left-handed coord system and imperial units IIRC does not endear it to me...).

That sounds (and is) rather negative, so in an effort to be balance that:

Using the Chris Hecker articles as an introduction, followed by Baraff's siggraph notes and then the decent books mentioned here should give you a good overview of all the basics you need to know, though using these for your first implementation would be daunting. Then there's a bunch of papers (most you can find on the web for free) worth reading - some of which will make everything seem very complicated, and some of which will make everything seem very simple! I'm pretty sure someone who posts here has made a web page with a list of most of the common/useful papers - but I've lost the link - will look for it!

One important thing is to write some little test projects as you go along, starting with simple stuff. They'll give you a code-base - e.g. you'll develop a maths library, and a basic rendering framework for testing - that will make it a lot easier when you come to write the hard stuff. And at the end of it you'll have some nice demos for job interviews :)

#13 Mach2   Members   -  Reputation: 130

Like
0Likes
Like

Posted 02 November 2005 - 01:19 PM

Quote:
Original post by MrRowl
Using the Chris Hecker articles as an introduction, followed by Baraff's siggraph notes and then the decent books mentioned here should give you a good overview of all the basics you need to know, though using these for your first implementation would be daunting. Then there's a bunch of papers (most you can find on the web for free) worth reading - some of which will make everything seem very complicated, and some of which will make everything seem very simple! I'm pretty sure someone who posts here has made a web page with a list of most of the common/useful papers - but I've lost the link - will look for it!

One important thing is to write some little test projects as you go along, starting with simple stuff. They'll give you a code-base - e.g. you'll develop a maths library, and a basic rendering framework for testing - that will make it a lot easier when you come to write the hard stuff. And at the end of it you'll have some nice demos for job interviews :)


I think that is the best recommendation. At least I found it works for my case.
I worked at my little physic demo for the last 4 months and although I still don't have much in it right now (just a couple of stacking cubes and bouncing around), I realized that I learned quite a lot from it. I started from scratch with some articles (Baraff's and Baltman's), some theses (Baraff's and Erleben's) and some nice demos as my "ultimate target" (b34r's and MrRowl's). After a while I bought the two books (Game Physics and Real-time Collision Detection) and i think that all the topics in the books is "nothing new" since you can almost find them in the net in form of articles, codes... (but i still recommend you these books since it will save you some times).

My experiences: Yes I did start with simple things, a small rendering framework, write my own math library (matrix, vector, quaternion,...) and start with collision detection between two cubes (maybe not a wise start) then apply impulse, integrate it and finally after everything work fine, I start to stacking boxes. I'm stopping doing it right now because of my time constraint but I will definitely come back to stacking more boxes sometimes later! It's so exciting...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS