Billiards

by Ebele Okonkwo

CSC 471 Intro to Computer Graphics, Fall 2014

Description

This program is a simple billiards game. The goal is to push all of the balls except for the cue ball into the pockets. The game logic has not been implemented apart from the fact that the only ball you can interact with is the cue ball. There is also no cue stick. If the cue ball falls into a pocket, you do have the option of resetting all of the balls' positions without restarting the program.

Screenshots



The program uses collision detection to determine if any of the balls are colliding with each other, the walls, or the pockets. If a ball goes near a pocket, it disappears instantly. The cue ball's direction is retrieved from the camera - the ball will always move forward. The camera can rotate around the pool table. The program uses three shaders to color the table, the pockets, and the balls. The textures used for the balls were found online. Damping is used to slow the balls down after they've been hit.

Commands

'o': move cue ball
space key: reset balls to original positions
'q': rotate camera down
'e': rotate camera up
'a': rotate camera to the left
'd': rotate camera to the right
'w': zoom camera in
's': zoom camera out
'esc': quit the program