Billiards Hall
Billiards Hall was my course project for Introduction to Computer Graphics. The project had only two requirements: it had to be animated, and it had to make do with OpenGL/GLUT primitives, using no external models. I followed the first requirement to the letter, but used a loophole in the second to include external textures. The application is written from scratch in C++ using OpenGL and GLUT.
The program is in essence a dimly-lit room with a carombole table in the middle and a set of randomly placed billiards balls. The player has a cue and can shoot the cue ball around, gazing in amazement as it rotates and moves the other balls. The physics is simple but fairly realistic, and the balls rotate correctly while moving.
Controls
- Move the mouse to look around the room.
- Use the usual A, S, D and W keys to walk around.
-
Use the left mouse button to perform actions:
- If you are close to the cue ball and looking roughly towards it, clicking the mouse will switch you into aiming mode.
- If you are in aiming mode, clicking the mouse will allow you to shoot the ball. The longer you hold the mouse after clicking, the stronger the hit.
- If you are near the light switch by the door, clicking the mouse will toggle the lights.
- Use the right mouse button to cancel aiming mode.
- Use ` or ~ to show or hide framerate and quality settings display.
- Use + and - to increase or decrease quality, respectively.
- Use Esc to exit the program.
The code should build fine on both Windows and Linux, but my quick test on Linux showed some pretty major graphical glitches. Since this is a toy, I didn't look too deep into it.