I am using c++/opengl. Can someone help me with a wrapper
for a 2d ball representation. I have one but its not complete.
I need other stuff like momentum and collision response.
Can you help me implement this?

Recommended Answers

All 3 Replies

How about a sphere instead? But keep it on a z = 0 plane to keep it 2D.

well a ball is a sphere and keeping z = 0 will make it a circle.

Read these articles:

http://chrishecker.com/Rigid_Body_Dynamics

You can probably ignore all of the rotational stuff, since a sphere is rotation-invariant.

You can get away with a very, very simple implementation if you're only considering spheres. But the other stuff in the articles is good, anyway.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.