The following are the steps to make a small animation of a bouncing ball:
- GLUT is initialized, the top-level window is defined as being of a specific size, its position is set, and, finally, the top-level window is created.
- The callback function is invoked to display a bouncing ball.
- In the callback function, the color buffers are cleared and the color of the bouncing ball is set to green.
- The glPointSize is set to 1 px because the circle will be drawn with the help of small points or dots.
- The GL_PROJECTION is set as the current matrix in order to enable parallel and perspective projections. Also, a two-dimensional orthographic viewing region is set up.
- To make the falling section of the animation, a ball is drawn at some ...