Visualization Experience

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

Basement Billiards is a practical demonstration of 2D collision between circles. Although the program is written in OpenGL and encompasses 3D space, the world has been rotated so that the negative z-axis faces down (as opposed to the traditional arrangement, in which the negative y-axis defines the down direction). This lets all calculations be done in the XY plane. Conservation of momentum is also demonstrated through perfectly elastic collisions, such as those between balls, and inelastic collisions, such as those between a ball and the rails. The entirety of the game code has been placed in the function

Get Beginning Math and Physics for Game Programmers now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.