How Can I create Collision between array of balls ?

Recommended Answers

All 2 Replies

Let all balls loose inside a closed container at once. Then you will see balls collide one another? =)

Anyway, what are you trying to do? Do you want a REAL collision or just an estimate (or rectangular) collision? The real collision detection needs to know the center of both balls (assume balls are perfectly circle) and their radiuses. The estimate needs a location at one corner of their boundary box and the size of the balls.

I recently built a colliding multiple ball app to use in my tutorials, and found this web site. I adapted the code from there, and it looks pretty realistic to me.

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.