Chadon Woods' Final Project CSC 471, Introduction to Graphics Winter 2007, Dr. Zoё Wood Introduction My final project is designed around a simple first-person shooter game. The “world” consists of a outdoor environement in which the player can walk around. Collision detection takes place between the player and the walls such that the player cannot walk straight through them. The view takes place through the eyes of the player’s character, with a on-screen display that shows the player's current number of kills, accuracy, time played, and health. In the center of the screen is the player’s crosshair, which is controlled by mouse movements. Also in the room is one Hierarchically-modeled AI bot that walkes around the world. Hopping around the room, are an assortment of bunnies that chase the player around the room with an intent to kill. Collision detection for both the bot and the bunnies takes place such that they stay within the walls. The player's health begins to go down is the bunnies get too close. This program was writen in C and uses OpenGL and GLUT. Feel free to download Bunny Hunter v1.0 here Program Usage A main menu may be displayed during gameplay by pressing the ESC key on the keyboard. During gameplay, the following commands are accessible
via the mouse and keyboard: |
|
Mouse controls:
|
Keyboard controls:
|
Bot's Hierarchical Modeling The bot is hierarchically modeled such that the arms and legs both have 2 pivot points each. The bot walking around the room, moving his arms and legs it a somewhat realistic manner. The bot is comprised of circles and cylinders that make up the different parts of its body. Animation The bunnies and bot are animated using OpenGL timers. These timers move the objects and also provide collision detection. Both the bunnies and bots detect collision with the walls and trees. When a collision occurs, their path of travel, or direction angle, is adjusted until they are free to roam again. The bunny timer recalculates each bunny's direction angle based on the angle of the vector from the player to the current bunny. The bunny is then repositioned to be facing the player at all times, allowing the bunny to chase the player with an intent to kill. |
|
|
Main Menu Screen
Options Menu Screen |
Texture Mapping I used texture mapping to map images to the wall, ground, main menu items, and moon. The ground and wall planes were both divided up into many polygons in order to support the "flashlight" feature during night mode. The stone image used for the wall was too big to map directly to one of the wall's polygons. Instead, parts of the image had to be mapped accross multiple polygons multiple times across the wall's entire surface. Object Picking and Selection Object picking occurs when the user clicks the left mouse button. The bot, bunnies, and trees all have picking enabled. During picking, the depth of the objects are also tested such that a bunny cannot be shot through a tree trunk, but can be shot thought the green part of a tree. Also, up to four bunnies may be shot at once time, if they happen to all line up in such a manner. Only one part of the bot may be shot at one time, such that each invividually-selectable bot part must be shot directly. Lighting and Materials I have a single point light source in my world during daylight mode, which is supposed to act as the sun. During nighttime mode, the player may choose to enable a spotlight light source, which acts as if the player is holding a flashlight. Depending whether the player is in day or night mode, certain object's material ambient property changes such that they emitt very little light at night, but emitt more during the day because of the sun.
Screen Shots: |
|
|
Playing Bunny Hunter during the day |
Playing Bunny Hunter at night, with the flashlight on | |
Future Additions The following is a list of items, had time permitted, that I would have liked to implement. Perhaps I may still add them one of these days.
References
|