Jump to content
  • Advertisement
Sign in to follow this  
Yours3!f

new to implementing physics

This topic is 2526 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I'm kind of new to simulating physics, so to start with something I thought of a 2D Pong, but I have no idea how to implement physics. I use my own math library (libmymath.sf.net), I have all the geometry data (vertices, and normal vectors from obj files) in memory I just don't know how to check collisions etc. I can display the whole stuff too.
Can someone point me to some tutorials on this topic, or explain some basic stuff to me?

Thanks,
Yours3!f

Edit: see the screenshot

Share this post


Link to post
Share on other sites
Advertisement
There are many great physics libraries out there. I would suggest looking into Havok, PhysX, Box2D, ODE, etc.

Other than that you may want to look at this book on Google to get started.
Physics for Game Programmers

For a simple pong game research bounding boxes and bounding spheres. When you detect a collision you would simply reverse the velocity of the ball to make it "bounce" off of the paddle in the opposite direction. Just Google "Pong Physics" and there will be plenty of resources for you to learn from.

Share this post


Link to post
Share on other sites

There are many great physics libraries out there. I would suggest looking into Havok, PhysX, Box2D, ODE, etc.


For a Pong game? It's like using a Ferrari to go to the bus stop. Just check if the ball is in the bounding box of the paddle and switch the direction of the ball velocity vector.

Share this post


Link to post
Share on other sites

[quote name='UltimaX' timestamp='1315939441' post='4861201']
There are many great physics libraries out there. I would suggest looking into Havok, PhysX, Box2D, ODE, etc.


For a Pong game? It's like using a Ferrari to go to the bus stop. Just check if the ball is in the bounding box of the paddle and switch the direction of the ball velocity vector.
[/quote]

I was simply making a point that there are already mature physics libraries out there; perhaps you failed to read the rest of my post. I said the exact same thing you just did ("When you detect a collision you would simply reverse the velocity of the ball to make it "bounce" off of the paddle in the opposite direction.").

Also, in his post he said "to start with", which to me means he would like more than just pong. If he stated it was for pong and pong only then I would have left that part out.

Please read someones post in its entire next time before jumping to conclusions.

Share this post


Link to post
Share on other sites

[quote name='Dunge' timestamp='1315945061' post='4861240']
[quote name='UltimaX' timestamp='1315939441' post='4861201']
There are many great physics libraries out there. I would suggest looking into Havok, PhysX, Box2D, ODE, etc.


For a Pong game? It's like using a Ferrari to go to the bus stop. Just check if the ball is in the bounding box of the paddle and switch the direction of the ball velocity vector.
[/quote]

I was simply making a point that there are already mature physics libraries out there; perhaps you failed to read the rest of my post. I said the exact same thing you just did ("When you detect a collision you would simply reverse the velocity of the ball to make it "bounce" off of the paddle in the opposite direction.").

Also, in his post he said "to start with", which to me means he would like more than just pong. If he stated it was for pong and pong only then I would have left that part out.

Please read someones post in its entire next time before jumping to conclusions.
[/quote]

Thanks both of you.

Ultimax:
I know these libraries, however I want to do all this manually, but thanks for pointing them out, I will look at the source of them, so I might learn from them. Thanks for the book too, this is exactly what I need. This will probably help me implementing this "bouncing" algorithm.

Dunge:
Yes it's useless to shoot a bird with a cannon, but as Ultimax pointed out, I hope this will be only the beginning, that is I hope to implement a full physics engine (or something like that) in the future. I like to know how the internals work when I work with a library.

So thanks again :)

Share this post


Link to post
Share on other sites

Hi [color="#1C2837"]Yours3!f,

[color="#1C2837"]You can check out my article in which I discuss the physics behind pong, among other things! :)

[color="#1c2837"]http://www.wildbunny...es-for-dummies/

[color="#1c2837"]Cheers, Paul.


Thanks but I've already read that, and its awesome!
I read the one about speculative contacts too, the idea is GREAT!

+ I ordered the book :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!