Final Deliverable Description
To make writing for Xlib easier, I made a C++ class about a year ago. I used this class in the project to help me avoid rewriting code that I already knew worked. As was necessary, I added to the class and moved functions from protected to public (mostly done to give me access to those functions necessary to make the graphics fast under X Windows). I even found some bugs that needed to be fixed and fixed them.
Of course, inspiration is not a finished project. Before spring break, my brother and I argued over what to do for the project. At first, we thought it would be easier to make a maze runner based on Forsyth's only with variable heights for the ceilings and floors. This idea posed some annoying problems when dealing with ramped floors, though. After a few days of literally arguing about using this idea and attempting to make something similar to the Descent engine, I finally convinced Joshua that I knew how to implement the clipping for the Descent engine. Actually, I was thinking of using a method which could not possibly have worked, but it kept me happy until the week of contracts when we talked to Forsyth. After meeting with Forsyth, I realized how absolutely flawed my method was and told Joshua about my problem. Joshua then told me about his idea to clip the walls after projecting them onto the view plane. He also had a method for recursing through the cubes which required some very complex concave clipping, but I ignored this and used my previous idea for recursion using convex polygons to derive the basic algorithm we finally used.
One thing that made me so insistant on making an engine that uses six sided maze segments is that each segment can be treated in exactly the same way. This meant that only one case had to be considered and debugged instead of several, and at the same time the engine would be capable of representing mazes more complex than a simple grid. The first step involves rotating and translating all of the points into camera space for the current cube. For each of the cube's faces (except for the one you entered through), the lines are clipped against a given z value to get rid of the distortions that happen near and below a z of zero. Once clipped in 3d, the points are converted into 2d, and clipped using the Sutherland-Hodgeman method against the entering face (the face which the recursion entered through). Both the new face and any polygons formed by the face intersecting the view plane are returned. The new face is either drawn if given a texture or continues drawing the cubes beyond. Whenever the view plane is intersected, the side outside of the current cube is drawn. These are the basic steps to the clipping engine though actually implementing these steps requires a bit more thought.
The movement engine represents the player as a sphere levitating above the floor. It uses a sphere so the player will be able to turn without getting stuck. The levitation is accomplished by shooting a vector through the floor and finding the distance to the intersection. If the intersection is less than the player's height, the player moves up, and if the intersection is more than the player's height, the player moves down. It also traces the path of a vector to determine the destination cube of the view plane when turning or moving which is important in making sure the engine begins drawing from the correct cube after the move.
A Final Set of Screen Shots - For the poor souls who can't run one of our executables. :-(




Executables! - Since we have an executable for so many types of computers, there is almost no reason why you can't try the program out for yourself. Each executible comes with a README file.
Source Code! - Wow! An actual 3d engine that works and isn't being kept top secret! Actually, the code and graphics are still protected by Copyright Law, so don't copy them and give yourself the credit. If you have any questions, just mail the person who worked on that part of the code. :-)