I've recently started a project, building a physics engine. I was hoping you could give me some advice related to some documentation and/or best technologies for this.
First of all, I've seen that Game-Physics-Engine-Development is highly recommended for the task at hand, and I was wondering if you could give me a second opinion.Should I get it? Also, while browsing Amazon, I've stumbled onto Game Engine Architecture and since I want to build my physics engine for games, I thought this might be a good read aswell.
Second, I know that simulating physics is highly computation intensive so I would like to use either CUDA or OpenCL.Right now I'm leaning towards OpenCL, because it would work on both NVIDIA and ATI chipsets.What do you guys suggest?
PS: I will be implementing this in C++ on Linux.
Answer
Here is how I learned to write a physics engine, its all free and highly recommendable:
David Baraff's papers particulary An Introduction to Physically Based Modeling
Brian Vincent Mirtich's Thesis Impulse-based Dynamic Simulation of Rigid Body Systems
Kacic/Bullock "A practical dynamics system" SIGRAPH 2003, EDIT: Link added.
Those papers were mentioned in another great article from Nick Porcino (LucasArts) in one of the gems-books Gems 4 "Writing a Verlet-Based Physics Engine". Its not free, but its worth every penny.
Also have a look at other engines, here is the source for the Bullet Physics Engine.
About the CUDA/OpenCL implementation: make it run on the CPU first, it's complicated enough :)
Be aware that most likely you will throw your engine away after a while, since its just too hard to make a stable and well integrated physics engine with a competitive feature-list on your own, however it's a great learning experience!
As soon as you have a simple engine running, my advice is: make test-scenarios where you compare the result of your engine with the result of another engine. This helped me find a lot of errors and it will improve your interface; something like appling a similar force for 1 second at the same body in both engines.
Last but not least: Ignore collisions when you start, focus on a stable simulation first.
No comments:
Post a Comment