CPSC 314 Project 4 Reilly Wood What: I have created a racing game, creatively titled ReillyKart. The player must race around a track and finish 3 or 5 laps before the timer runs out. The player’s car can jump, and if it runs into any of the boulders that roll around the track it stops. I implemented collision detection for the advanced functionality. My collision detection checks whether the player and the boulders are on the track, and it also handles collisions between boulders and the player. How: First, my application reads in texture information, stored on disk as TGA files. Then it reads the track information in from a simple text file. The track is stored as two sets of vertices (vectors of the simple Vec3 struct from project 3), one for the outer contour and one for the outer contour. The track is then constructed using a tesselator from the GLU library, so that it can easily handle tracks with concave shapes. Collision detection is handled in two different ways. 1) Collision between the car and boulders (or boulders and boulders) is handled using spheres as bounding boxes. Boulders bounce off and reverse direction whenever colliding with other boulders or the player. The player slows down a lot whenever colliding with a boulder. 2) Determining whether objects are on the track is determined in a more complex way. This collision detection is essentially done in 2D using the scanline algorithm - for every edge in the track, we check whether the given point is to the right of that edge. If the number of such edges is odd, then the point is on the track. This is done twice - once for the outside contour of the track, and once for the inside. The car can fall off the edge of the track, but boulders cannot - they simply bounce off the edges. To determine which edge the boulders hit (so we can calculate the angle at which they bounce off), I compare the boulder’s location to every edge of the track and assume that it hit the closest one. Picking is done using the select/hit method supported by GLU (gluPickMatrix). It is used at the start menu only - the user can choose between 3 or 5 laps for the race by clicking on one of 2 different cubes. The HUD is implemented using an orthogonal camera. It contains standard information (FPS, time, laps) as well as a map of the course with the current location of the car. How to: First, pick the number of laps using the mouse. Then, driving is done using the WASD keys. The space bar makes the car jump - useful for avoiding boulders or sharp turns. The C key changes the camera from first-person to third-person and back. The player must finish all laps of the track in the given time (1m10s) to win. Sources: I used code to load TGA images as textures from http://gpwiki.org/index.php/OpenGL_Tutorial_Framework:Texture_Mapping I also used code to generate a checkboard texture from http://glprogramming.com/red/chapter09.html I consulted the following site for help with picking: http://www.lighthouse3d.com/opengl/picking/index.php?openglway2 I consulted the following site to get started with the HUD: http://iphonedevelopment.blogspot.com/2010/02/drawing-hud-display-in-opengl-es.html