Project 3

Squishy Pong

This third project will give you some experience with physically-based modelling and particle systems by updating the old standard 'pong' to include a ball made with springs.

The original pong was played by two players on a 2D playing field with rectangular paddles and a square ball. For this class the field of play will become the interior of a transparent cube allowing 3D play.

The player should see a perspective view of the playing area.

There will be just one player with his/her paddle on the left side of the screen/cube. The player will use their mouse to move the paddle up/down and in/out over the left wall. The player's paddle can not leave the left wall of the cube. If the ball gets past the player then it goes out of play and a new ball should be served towards the right wall.

For the paddle controls:

The ball will not be a square, it will be a shape made out of springs. - thus the ball will deform when it hits the player's paddle, or the walls of the cube. Several ball shapes will be possible: a 5 sided pyramid, a 6 sided cube, and a sphere. You should colour the faces of the 'ball' appropriately so it is easy to see the amount of deformation.

The direction and speed of the paddle should have an effect on how the 'ball' bounces off the paddle.

You walls are not squishy. You can decide whether to make the paddle squishy or not.

You will allow the player to change the spring constants, speed of the ball, speed of the paddle. You should play around with the various constants to identify several that you think are particularly interesting and point those out to the player. The defaults should focus more on seeing the deformation of the ball than on making the game challenging for the player.

You should pick some appropriate colours and you may want to introduce some sounds.

To help you along with this project I am providing some C/GL code that Jason Leigh wrote one afternoon. It gives you the basic spring and collision routines and then uses them in a simple demo of a pyramid falling onto a flat surface. One thing to note about this code is that it is written in GL the precursor to OpenGL, so you will need to modify the graphics routines to take advantage of GLUT. The code comes with a GL executable which should run on the current SGIs but GL was only supported on the SGI. This code should give you a very good start on the routines you will need for this application.

That code, and SGI executable can be found here in physics.tar.gz

Doing this well will get you a 'B' on the project. To get an 'A' you need to add some value to the experience with a particle system of some kind. For example, you could add a little particle system to the ball so there are flames or smoke comeing out of it. You could have some other little balls flocking after the big ball (though only the big ball collides with anything.) Be creative. Come up with something that looks cool.

The requirements on this assignment are intentionally left a little vague so you have some more freedom to come up with something more interesting.

As always, all of the code that you turn in, aside from the code that I am providing, should be your own.

On the due date you should email me a directory which contains the source code and an executable that I can run on a standard SGI O2. The code should run well (i.e. at a reasonable frame rate) on a standard SGI O2.

last revision 10/14/01