Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I need to write a simple 3D billiard game using OpenGL. Which physics engine is simple and best to use in this case? Or it's better to write physics by myself?

share|improve this question

closed as not constructive by Sean Middleditch, bummzack, Josh Petrie, Trevor Powell, Byte56 Apr 4 '13 at 22:22

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

6  
Is there any reason why you can't use a 2d physics simulation? After all, the action of the game all takes place within 2 dimensions, unless you're hitting the ball too hard or too low. But other than that the balls generally collide at their middle with all other objects in the game. I don't see why you couldn't just use a 2d simulation. Going full 3d physics just to allow players to knock the ball off the table seems overkill. –  Digital Architect Mar 24 '13 at 13:31
add comment

1 Answer 1

up vote 5 down vote accepted

I've written a simple 2D billiard-like game using Box2D before.

As Digital Architect pointed out, unless the ball jumps from the table, 3D physics is overkill. And you can use 2D physics with 3D graphics.

If you decided to implement physics by yourself, this is what you'd have to do (which are already implemented in Box2D):

  1. Circle-Circle collision detection (when balls collide)
  2. Circle-Polygon collision detection (when balls collide with the edges, which are not rectangles)
  3. Handling collision (so that balls that collide move accordingly, depending on the coefficient of restitution)
  4. Damping
  5. Applying forces (or at least set the velocity of a ball)
  6. Sensors (for the holes)

Also, you'd have to make sure everything works properly (no obvious bugs, which can be a pretty hard problem unless you really know what you are doing) and efficiently.

share|improve this answer
    
Thanks for your answer, using 2D engine was obvious solution. Hope this will work for me. –  DarkSun Mar 24 '13 at 13:57
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.