Ricky Tam
CSC471 Final Project
Fall 2010
There always comes a time when some bored random person in the world dreams of creating a 2D maze on paper and transform it in to a 3D playable maze. Now that person may make their dream come true with Maze Generator. Taking a basic, user-created text file of a 2D maze, Maze Generator magically transforms it in to 3D, making your wildest maze-dreams possible!
Maze Generator takes in a basic ASCII file and translates it in to a 3D maze. Figure 1 shows two examples of a ASCII maze file: a simple 10 x 10(left) maze and a complicated 100 x 100 maze(right).
Figure 1: ASCII maze files.
Maze generator takes three header numbers in the ASCII file. The first number represents the width of the maze, the second is the height of the maze, and the third is the number of End-Portals in the maze.
The modeling in this program was created using a few primitive objects. The final bird model in this program is animated. Initially, the model of the bird was a spherical object with wings, found in Figure 2. Each space in the ASCII file is represented by these ASCII characters:
Figure 2 shows an example of a generated maze with a starting portal, ending portal, and trampoline.
Figure 2: Example maze.
These are the basic controls for moving around the maze:
- Mouse movement rotates the camera around
- Mouse left click will invoke actions when standing on top of objects
- 'w' - moves forward in the direction of the camera
- 'a' - strafes left in the direction of the camera
- 's' - moves backward in the direction of the camera
- 'd' - strafes right in the direction of the camera
- 'r' - resets the player at the starting point of the maze
- 'l' - toggles between no lighting and "spooky" lighting (in testing)
- 'esc' - quits the Maze Generator
Figure 3: A rendered trampoline in a generated maze.
Moving on top of a position and clicking the left mouse button will make the user jump in to the air, modeling physics gravity. Figure 4 shows an example of what the user might see when they are launched in to the air.
Figure 4: The user looking around in the air after jumping from a trampoline.
Warp portals are a unique design in the Maze Generator. Warp portals create complete randomness in the maze! You have no idea where you will end up, so take a starting portal at your own risk! These are the two types of portals:
Start-Portals
Starting portals are located on the floor of a walkable path and spin around mystically. An example of a portal is shown in Figure 5.
Figure 5: A rendered starting warp portal in a generated maze.
Stepping on one of these will start warping the player to a randomly chosen ending portal in the maze. When the starting portal is clicked on top of, swirling purple particles shoot out of the portal, telling the user they will be warped soon. This is shown in Figure 6.
Figure 6: A starting portal that has been clicked on top of (left) and the starting portal animation viewed from a distance(right).
Ending portals are located above the floor of a walkable path and spin around mystically. An example of an ending portal is shown in Figure 7.
Figure 7: An rendered ending warp portal in a generated maze.
When the user is warped to a randomly selected ending portal, they will be shot out of the ending portal in the air and land on the ground. Figure 8 shows this happening.
Figure 8: A starting portal that has been clicked on top of (left) and the starting portal animation viewed from a distance(right).
Figure 9: An ending portal animation during the warp period.
All animations on based on a counter in an idle callback function so for a large maze, animations are typically slower than a smaller maze. I did not know there was a timer callback. All animations will be changed to a timer callback in the future.
OpenGL documentation - Used for looking up how to use functions.
Google! - A great resource to look up textures!