O'Reilly logo

Beginning Math and Physics for Game Programmers by Wendy Stahler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Visualization Experience: Collision Detection

On the CD-ROM, you will find a demo named Circles. Here's a brief description from the programmer:

This example is used to demonstrate the movement and collision of two circles with the bounds of the screen and each other. The circles are placed in random positions on the screen and are given random directions to travel in. To maintain simplicity, true vector reflection is not used for the collision of the balls. Instead, a basic reflection algorithm is used to maintain the appearance of true reflection.

Dustin Henry

Go ahead and run the demo by double clicking circles.exe. You'll see the two balls bounce around and occasionally collide with each other. Behind the scenes, the computer is checking ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required