Pool Scene by Zachary Vaughan completed 12/07/2003 C++/OpenGL/GLUT platform README.TXT ----- BASIC CONTROLS: - Arrow keys control view rotation. - Press "W" (or "w") to toggle wireframe mode. - Press "L" (or "l") to toggle overhead lights on and off. - Press "R" or "r" to increase or decrease rate of movement (respectively). - Press "Z" or "z" to zoom out or in (respectively). - Press "V" or "v" to elevate camera focus upwards or downwards (respectively). ----- The general idea of this project was to design an elegant-looking pool table with the ability to knock the balls around and "play pool" in a virtual realm. The basic steps for my project were the following: - design the pool table felt surface - find ways to optimize work overhead like - reflection - formulae, subroutines - minimal hand calculations - use and manage multiple texture maps and mipmapping - add lighting to the scene that can be turned on and off - implement a collision algorithm for the balls - draw pool sticks that can be used - implement a floor and ceiling, possibly walls - allow zooming and strafe Of these steps, many were actually completed. Some of the steps required far more work than expected, namely the design of the felt table and textured table surroundings and pockets. I discovered that it would be significantly harder to implement cylinder formulae for the pockets and align that with texture maps and linear interpolation used for wood surroundings. Therefore I resorted to hardcoded vertex, normal and texture coordinates. My most notable time-saver was the four-way reflection algorithm I used to allow me to only have to draw one-quarter of the table at a time, then do scaling transformations along the x- and z-axes for the desired table. The one problem with this algorithm is that it also flips back and front faces, which left me with no choice but to completely gut the program of all back face culling. This only limits the wireframe mode, however, and so it is not a huge loss. Things still look the same. Normal vectors do not exactly line up with their ideal directions in certain places, but this does make for certain tradeoffs such as more realistic bumper shapes but less distinguishable bumpers from the actual felt surface when viewing at a near-horizontal angle. Hardcoded points are flexible in one way - the table can be extended to any size necessary by changing two constants: FIELD_WIDTH and FIELD_HEIGHT. Thus the available playing surface can be shrunk to be very small or expanded to be very large as needed. This was originally implemented for debugging purposes and for the possible collision algorithms to be added later. Floor textures, stained glass textures, and "wood" textures were found online. Lights do not exactly align with the bulbs. Three white lights are used, each with 1/3 intensity. The outer two lights are positioned lower than the bulbs and the inner light is positioned higher than the bulb. One glitch that I'm not sure how to fix is the floor texture mapping problem. It seems that no matter how I try to realign the texture or change its size, the texture still becomes insanely grainy at non-axial angles. Perhaps this is a mipmapping problem??? Collision algorithms would not be too hard to implement, but the time required to build the table itself doesn't warrant any additional work, so the balls are stationary for the time being. ----- Questions or Comments? email Zachary Vaughan at: zvaughan@ieng9.ucsd.edu