Click here to order the books.
In Chapter 7, we discuss the game physics and implement several game simulators, including a bouncing ball simulator. An important aspect of physics modeling for games is what happens when two objects collide. Do they bounce off each other or stick to each other and travel together? If the objects do bounce off each other, which direction do they travel after collision and at what speed do they travel? In this example, we'll consider what happens when a ball hits a wall or a flat ground.
In most ball bouncing animations, a linear collision approximation is usually used. Namely, only the vertical component of the velocity changes signs when the ball hits a wall or surface. This isn't a realistic situation. In reality, when a ball is incident obliquely on a flat surface, the ball's rebound spin, speed, and angle will generally differ from the corresponding incident values. This is much more complicated than a linear collision approximation. In this example, we'll investigate physics of a general bouncing ball and create a general bouncing ball simulator.
The physics of a bouncing ball is characterized by the coefficient of restitution (COR) of a ball for a vertical bounce. The COR for a vertical bounce off a flat surface that remains at rest is defined as the ratio of the rebound speed to the incident speed. The horizontal COR can be defined for an oblique impact in terms of the horizontal components of the incident and rebound speeds of the contact point on the ball.
Consider a ball of mass m and radius R incident at speed V1, angular velocity w1, and at an angle theta1 on a flat surface, as shown in the following figure.

For simplicity, it is assumed that the mass of the surface is infinite and that the impact force is much larger than the gravity force during collision . In this model, the equations of motion are not needed explicitly, because the collision can be described in terms of the vertical (CORy) and horizontal (CORx) values of the COR, together with the conservation of angular momentum about the contact point. Referring to the above figure, we can define
Here, the subscripts 1 and 2 denote conditions before and after the collision, respectively. Similarly, CORx can be defined by the relation:
where Vx - Rw is the net horizontal speed of a point at the bottom of the ball. Unlike CORy, CORx can be either positive or negative. If a ball is incident at a sufficiently small angle and without spin, it can slide throughout the impact without rolling and will bounce with Rw2 < Vx2, in which case CORx < 0. A value of CORx = -1 corresponds to a bounce on a frictionless surface, where Vx2 = Vx1 and w2 = w1.
The horizontal friction force F exerts a torque FR = Idw/dt, where I is the moment of inertia about an axis through the center of the ball, so that
The conservation of angular momentum about a point at the bottom of the ball is therefore described by the relation
The moment of inertia of a spherical ball is given by I = 2mR2/5. The above equations can be solved to show that
The above results are very interesting. If w1= 0 and CORx = 1, then Vx2 = 0.43Vx1 and the corresponding spin value is Rw2/Vx2 = 10/3. This means that the ball spins much faster than you would expect from the rolling condition Rw2/Vx2 = 1. At the end of the collision, the ball with CORx = 1 will therefore slide backward on the surface due to the recovery of elastic energy stored in the horizontal direction. Alternatively, if w1= 0 and CORx = 0, then Vx2 = 0.71Vx1 and Rw2/Vx2 = 1, indicating that the ball rolls at the end of the duration of the impact and there is no energy recorvery or no energy stored elastically in the horizontal direction.
Because CORx is close to 1 for a superball and close to zero for a tennis ball, a superball will bounce with a smaller Vx2 component than a tennis ball when w1= 0 and Vx1 are the same for both balls. Since Vy2 is larger for a superball (for the same Vy1), a superball will bounce at a steeper angle than a tennis ball. It is also easy to show that a superball with the same radius and same value of Vx1 as a tennis ball will bounce with a greater spin, by a factor of 2.38 if w1 = 0.
With the above physics analysis for the boucing ball model, we can develop a realistic bouncing ball simulator that incorporates the inelastic collision, the change of horizontal speed, and the spin of the ball. The simulator is called BounceBall, and a screen shot is shown in the figure below. You can click the play button to play the video. The simulator consists of a ball inside a 2D 100m×100m box. When it travels inside the box (without collision), only gravity acts on the ball. If only the initial position of the ball (say x0 = 50m and y0 = 95 m) is specified and the initial velocity is set to zero (V0x = V0y = 0), the ball will drop as a free-fall object. The text fields allow you to change the mass, radius, gravity, and coefficients of restitution, as well as the initial position, velocity, and angle velocity. A Start button starts the simulation, a Stop button stops the simulation, and a Reset button stops the simulation and resets the ball and the parameters to their original position and values.
You can look at the book to learn the detailed implementation process and view the complete source code of this
example. you can play around with the bouncing ball simulator. Select a different set of input parameters
and see what happens. The most interesting thing that may surprise you is that the ball will rotate (spin) at
a high angular speed after collision, even its initial angular velocity is zero.
Also, you can see the difference between a superball and a tennis ball using this simulator. Experimental data show that the coefficients of restitution are very different for superballs and tennis balls. For the superball, CORx = 0.76 and CORy = 0.86, while for the tennis ball, CORx = 0.24 and CORy = 0.79. You can perform the simulation with these two sets of parameters to examine the results. You'll find that the superball will bounce with a faster spin speed than the tennis ball.