COSC363 Assignment 1 Ryan Beaumont Compilation - Command line: g++ -o assignment1.out assignment1.cpp -lm -lGL -lGLU -lglut ./assignment1.out - IDE: Import the project using the CmakeLists.txt. Ensure the resources folder is in the build directory. Controls - Up & Down arrows move the camera forwards and backwards respectively. - Left & Right arrows rotate the camera left and right respectively. - Page Up & Page Down move the camera up and down for viewing the roof and bottom skybox face. - End closes the program. - “A” key starts and stops the animation of the Running Man. - “S” starts and stops the swinging of the Spotlight. - “C” starts and stops the animation of the Red Car. - “B” will make the Flying Plane do a backflip. - “F” will fire the Cannon. - “U” Increases the firing angle on the Cannon barrel - “J” Decreases the firing angle of the Cannon barrel - “I” Increases the firing velocity of the Cannon. - “K” Decreases the firing velocity of the Cannon. - “O” Increases the gravity affecting the Cannonball. - “L” Decreases the gravity affecting the Cannonball. - “P” resets the gravity affecting the Cannonball to 9.81. Models Running Man The Running Man runs back and forth around a large circle, turning around and running the opposite way after each full circuit. In addition, his arms and legs are animated in a running motion. He is comprised of three GlutSolidSpheres, four GlutSolidCylinders and one GlutSolidCube. In the screenshots underneath the Running Man is shown at standstill and during his walking animation. This animation is started by pressing “A”. Red Car The Red Car drives around in a small oval type shape on the left side of the building. It was made using two GlutSolidCubes and four GlutSolidCylinders. Below it can be seen rotating around one of the bends in its path. Its animation is started by pressing “C”. Flying Plane The Flying Plane flies around the centre of the room in a figure of eight shape. Upon pressing “B” the Flying plane will do one full backflip before continuing its figure of eight path. The Flying plane and its rotor are constructed from OFF files I wrote based off the sketches below. The rotor is comprised of 17 vertices and 20 faces, the plane, 50 vertices and 49 faces. They were drawn as separate objects so that I could animate the rotor spinning independently from the plane body. Swinging Spotlight (Moving Spotlight) The Swinging Spotlight is comprised of a GlutSolidCylinder, GlutSolidCone and a spotlight. It swings back and forth from -30 to 30 degrees. As it swings the angle of the spotlight attached to it can be seen changing along the floor of the scene, becoming more oval as the angle of the light approaches -30 and 30 degrees. The animation starts when “S” is pressed. Sphere and Spotlight (Planar Shadow) The GlutSolidSphere and spotlight on the right side of the room are an example of an object casting a planar shadow based upon the light source it is underneath. The shadow has been lifted 0.1 units off the floor to prevent interference from the floor polygons. Cannon (Physics-based Animation) The Cannon is taken from my work on Lab 2. For the assignment, it is used to implement a physics-based animation, the flight of the cannonball. My model considers the launch angle, launch velocity and gravity. It ignores air resistance. These three variables can be adjusted to change the trajectory of the cannonball. Based on those three variables it will move the cannonball along a trajectory until it travels below the floor plane. Calculations in the model use the scale of one unit in OpenGL is equal to one metre. Calculations are shown below. Pressing “F” will fire the Cannon. Skybox, Building and floor The skybox around the scene uses the Skybox4 textures provided on Learn. It is 400x400x400. The building has been textured on all walls and the roof. It also has an automatic door that opens and closes depending upon the camera’s proximity to them. The building is based on the sketch shown below and is 50 units long and 50 units wide. The floor plane has also been textured and is constructed of many GL_QUADS so that light can be correctly rendered on its surface. The floor runs from x = -50 to x = 50 and z = -100 to z = 10 making it 100 units by 110 units in size. References - Skybox Texture o Skybox4 provided on Learn. - loadTGA.h o Provided in the course labs. - loadMeshFile.h o Adapted from the code provided to us in the labs for drawing objects from an off file. - Cannon.off o Provided in the course labs. - Building Wall Texture o BrickSmallDark0012. (2020) Retrieved April 6, 2020, from https://www.textures.com/download/bricksmalldark0012/14842 - Building Roof Texture o RooftilesMetal0012. (2020) Retrieved April 6, 2020, from https://www.textures.com/download/rooftilesmetal0012/27257 - Floor Texture o FloorsRegular0197. (2020) Retrieved April 6, 2020, from https://www.textures.com/download/floorsregular0197/17502