Writing Physics Engine for DirectX 9

Started by
4 comments, last by Aqua Costa 11 years, 9 months ago
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.
Advertisement
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: http://www.amazon.com/Physics-Second-Edition-David-Eberly/dp/0123749034/ref=pd_sim_b_32
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 topic.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Alternatives to PhysX include Bullet, Havok, ODE and Newton. Chipmunk and Box2D are popular 2D physics engines.

If you want to learn how to write your own physics engine, I recommend the books Game Physics, 2nd ed., Real-Time Collision Detection, Geometric Tools for Computer Graphics and Game Physics Engine Development. 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. Game Physics Engines: and Introduction.

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!
What is most used Physics Engine in commercial 3D Games out there (especially, first-person shooter games)?

What is most used Physics Engine in commercial 3D Games out there (especially, first-person shooter games)?


The most used is probably Havok (take a look at this list).

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.

This topic is closed to new replies.

Advertisement