1. Team members: Alex Curelea and Adam Blanchard 2. Submitted animation: proj (executable - interactive animation) 3. Source and data files: asst3.cpp // main animation file cannon.cpp // cannon object - generate and draw cannon.h // header file for cannon object hardhat.cpp // hardhat object - read from hardhat.obj and draw hardhat.h // header file for hardhat object hardhat.obj // hardhat object file in Wavefront format libglui.so // library file makefile // make file penguin.cpp // penguin object - generate and draw penguin.h // header file for penguin object polygon.cpp // modified polygon object from assignment 1 polygon.h // header for polygon object rfHillTerrain.cpp // terrain object rfHillTerrain.h // header file for terrain object rfHillTerrain.inl // inline function declarations for terrain object shell.cpp // object used to represent projectiles shell.h // header file for shell object utils.cpp // helpful functions needed across files utils.h // header for utils vector.cpp // modified vector object from assignment 1 vector.h // header file for vector object 4. Compile: This program was tested only on the Linux CDF labs (BA3228). We know it doesn't compile elsewhere... To compile, use: make To run, use: proj [-D][seed] where: -D is an optional flag that activates Debug mode, which has many useful options and parameters. seed is an integer value used as the random number generator seed for the terrain. 5. Description Our project is a game where the objective is to shoot penguins with a cannon. (Confused about the hardhats and cannon? See http://traditions.skule.ca or http://kaboom.skule.ca. As for the penguins, don't ask.) There are two main modes of operation: - standard game mode. This launches by default. Instructions are shown for the keys to use - when a penguin is shot, the score increases, when all the penguins are gone the next "level" loads, with twice the number of penguins and a faster speed. - debug mode. This lanuches when the '-D' command line switch is used. This mode allows changing most of the animation parameters, as well as allowing camera movement with the mouse, like in assignment 2. Please note that some of these parameters might be stretched beyond the breaking point of the program; the code is written assuming the default parameter values (the ones in the standard game mode), and some values in debug mode might lead to unexpected results. Quick overview of the debug options: - Penguin speed: self-explanatory, should make penguins move faster. Also controls the way they waddle. - Gravity: should affect projectile motion, such as the cannon ball, penguins and hardhats. - Hip-hop Penguin: a fun easter egg (let the penguins get close to the camera first). - Number of penguins - self-explanatory. - Landscape height & Landscape scale - change the properties of the landscape - the camera will most likely have to be moved as well. - Apply - the previous three options will only take effect when you hit Apply; the entire scene will be reset. - the rest are camera settings. The penguin and the cannon barrel are effectively a lathed surface. We decided on the outline points on a piece of paper, then wrote code to lathe them in a circle to create the object. The cannon base and wheels, penguin flippers, eyes, beak and feet were basically modelled by hand. The hardhat is imported from a .obj file. All objects are stored in display lists, to improve performance and simplify things. Each object has its own display list, which might not be the most efficient memory-wise, but it simplifies drawing. The penguin texture is generated in asst3.cpp - we didn't want to write a .bmp file importer, so we simply generated a texture with a white circle inside, which is the white circle on the penguin. Penguin animations: - Each penguin moves towards the camera linearly. We also have two rotations to simulate the penguin waddle, as well as a rotation to align the penguin's Z-axis with the surface normal of the terrain at the respective location. - Once a penguin is hit, it uses simple projectile motion equations to determine a parabolic path - from where it was hit, to wherever it lands. An extra rotation around the penguin's center is added. - Once a flying penguin is detected to have hit the ground, its motion stops. Cannonball animation: - The cannonball uses motion equations to calculate its path. It disappears when it hits a penguin - which is determined by calculating whether it is inside the penguin's bounding box - or when it hits the ground - which is determined by comparing its Z value with that of the terrain point with the same X and Y coordinates. Cannon animation: - The cannon motion is controlled by the user. The cannon can be rotated around its Z axis as an entire unit (base + barrel), and the barrel can also be rotated up and down. Cannon guard (the 4 penguins around the cannon): - They are simply placed around the cannon, and rotated using the same rotation as the cannon. Material Properties and Light - All objects (except the textured penguin body) are given material properties, to allow for differing colour properties (ie so the hardhats look like a different material than the penguins). This meant that we had to find surface (and in many cases vertex) normals for everything, which was possibly the most time-consuming part of this entire project. - A single infinite location light is used to light the scene. Snow and Fog - A particle system was created to simulate falling snow. Snowflakes are simply OpenGL points that were given a white material and a vertex normal. They would look a lot better as actual textured objects, but it would also probably slow down the scene vastly. - Fog was created using OpenGL fog. What we wish we had time to implement: - Windows compatibility - explosion effects (we tried using transparrency for this, but CDF computers don't seem to support it) - a sky texture - cannon fire effects - time record & number of shots fired for accuracy - actual text in the OpenGL window - e.g. a "Welcome" text, "Level 1", etc. - clean up our code! 6. Cited Sources: - Snow code was adapted from: http://nehe.gamedev.net/data/articles/article.asp?article=06 - We used and slightly modified (one function added for finding exact height values) the terrain code from: http://www.robot-frog.com/3d/hills/ - The hardhat object was modified (lamp removed) from the miner helmet found at: http://www.greylight.com/poserheadgear.html 7. Division of Labour: Alex did: - lathe method - penguin model and texture - hardhat modification & import - terrain - collision detection & terrain height stuff - flying penguins & hardhats after they get hit Adam did: - cannon model - fog and snow - materials - lighting - penguin walk animation (waddle) - debug interface We worked together on: - animation and controls - the math! - pretty much everything