Home » DEMO COLLIDING BALLS

DEMO COLLIDING BALLS

Features:

  • RT-DESK v2.0
  • x32 bits, x64bits
  • OpenGl
  • Single-threaded program

Description:

It consists of a box containing balls and these balls bounce off each other without going beyond the box limits. To avoid missing collisions, every time a ball travels a distance equivalent to its diameter, it must check possible collisions. This implies that the frequency for the execution of the update method in each ball depends on the speed of the ball. Each ball begins with a certain position and speed. The position is calculated through a simple equation depending on time and speed. The speed decreases every time the ball touches a wall of the box.

If two lines of balls are formed and the balls in one of the lines travel in the opposite direction to the balls in the other line, we get two lines of balls that continually collide and bounce off each other. The idea is to show how the runtime of an application with Continuous Mode can unpredictably fail whereas Discrete Mode guarantees a correct simulation.

 

OSG Version

 

 

 

Author: Vicente Broseta Toribio (vibroto<at>doctor<dot>upv<dot>es)