Sign in to follow this  
Medo Mex

Writing Physics Engine for DirectX 9

Recommended Posts

Medo Mex    891
I am trying to create a Physics Engine for 3Ds games by myself, I want to know the basic idea on how Physics engine is created.

I will be load all the meshes from .x file. Edited by Medo3337

Share this post


Link to post
Share on other sites
Asesh    276
First of all I would never do that and neither would any game industry. Use PhysX, it's free. If you really wanna do so then I would recommend "Game Physics 2nd edition by David: [url="http://www.amazon.com/Physics-Second-Edition-David-Eberly/dp/0123749034/ref=pd_sim_b_32"]http://www.amazon.com/Physics-Second-Edition-David-Eberly/dp/0123749034/ref=pd_sim_b_32[/url]

Share this post


Link to post
Share on other sites
L. Spiro    25622
The reason you have not gotten much in the way of replies is that you have posted a physics question in a graphics topic.
It isn’t really relevant that your images are in .X format and you are rendering via DirectX, but it is a bad sign as far as the outcome of your project is concerned. Since you aren’t able to distinguish between the different modules of your product, you won’t be able to really make anything until you get a lot more experience.

That doesn’t mean you can’t try, since that is the only way to get experience, but you should move your question to the appropriate [url="http://www.gamedev.net/forum/20-math-and-physics/"]topic[/url].


L. Spiro

Share this post


Link to post
Share on other sites
clb    2147
Alternatives to PhysX include [url="http://bulletphysics.org/wordpress/"]Bullet[/url], [url="http://www.havok.com/products/physics"]Havok[/url], [url="http://www.ode.org/"]ODE[/url] and [url="http://newtondynamics.com/forum/newton.php"]Newton[/url]. [url="http://chipmunk-physics.net/"]Chipmunk[/url] and [url="http://box2d.org/"]Box2D[/url] are popular 2D physics engines.

If you want to learn how to write your own physics engine, I recommend the books [url="http://www.amazon.com/Game-Physics-Second-David-Eberly/dp/0123749034"]Game Physics, 2nd ed.[/url], [url="http://www.amazon.com/Real-Time-Collision-Detection-Interactive-Technology/dp/1558607323"]Real-Time Collision Detection[/url], [url="http://www.amazon.com/Geometric-Computer-Graphics-Morgan-Kaufmann/dp/1558605940"]Geometric Tools for Computer Graphics[/url] and [url="http://www.amazon.com/Physics-Development-Kaufmann-Interactive-Technology/dp/012369471X"]Game Physics Engine Development[/url]. After those, there are several good talks (e.g. from GDC and Siggraph) related to game physics, also google can help with those, see e.g. [url="http://www.lirmm.fr/~koriche/W-Docs/Game-PhysicsEngine-2007.pdf"]Game Physics Engines: and Introduction[/url].

When writing a physics engine, I recommend keeping it strongly and strictly separated from DirectX 9. The rendering and physics part should not have any dependencies, since in a few years in the future, you will no longer be using DirectX 9, but want to keep using your physics engine, so it's best to plan for that in advance.

I don't want to patronize, but even though I consider myself an industry veteran, I think if I started writing a physics engine, it would take me well more than a man-year of development effort to create one that I might be mildly satisfied with.

Perhaps you are not looking for a complete 3D game physics engine, but are looking to implement simple physics-like behavior in your game. For that goal, writing your own physics-like logic update code is not that difficult, and can be simpler than integrating with a full-featured implementation.

Also, just for learning purposes, tackling a DIY project for full-blown game physics engines is of course ok, and if you're really looking towards that, good luck on your endeavour!

Share this post


Link to post
Share on other sites
Aqua Costa    3691
[quote name='Medo3337' timestamp='1340800254' post='4953311']
What is most used Physics Engine in commercial 3D Games out there (especially, first-person shooter games)?
[/quote]

The most used is probably Havok ([url="http://www.havok.com/customer-projects/games"]take a look at this list[/url]).

Anyway, you shouldn't write a physics engine for DirectX (especially not for DirectX 9)... A physics engine should (*must*) be graphics API independent! Plus when the next gen of consoles is released no one will use DirectX 9, and you probably won't have finished your engine by then, so you will be developing for a deprecated API. Edited by TiagoCosta

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this