| 1 | = 3D Computer Graphics Final Project - Flight Simulator / Cory Island = |
| 2 | |
| 3 | [[Image(thumbnail.png,right)]] |
| 4 | |
| 5 | Completed in fall 2004. |
| 6 | |
| 7 | == Compiling == |
| 8 | * gcc/make: |
| 9 | * Run "make" |
| 10 | * Visual Studio/nmake: |
| 11 | * nmake /f Nmakefile |
| 12 | * */scons: |
| 13 | * Run "scons" |
| 14 | |
| 15 | == General Controls == |
| 16 | * ![1] Fly the plane. <-- Use one of these if you crash. |
| 17 | * ![2] Drive the car. |
| 18 | * ![3] Drive the boat. |
| 19 | * ![4] Go for a walk. |
| 20 | * [m] Toggle between first-person and third-person view. |
| 21 | * [g] Toggles full-screen mode. |
| 22 | * [i] Resets the scene to its initial configuration. |
| 23 | * [q] Exit. |
| 24 | |
| 25 | == The Plane == |
| 26 | * [f] Moves the plane forward and pauses motion of the plane. |
| 27 | * [w] Makes the plane accelerate, unpausing it if it is paused. |
| 28 | * [s] Makes the plane slow down, unpausing it if it is paused. |
| 29 | * [a/d] Roll the plane (rotate about its Z axis). |
| 30 | * [left/right arrows] Yaw the plane (rotate about its Y axis). |
| 31 | * [up/down arrows] Pitch the plane (rotate about its X axis). |
| 32 | * [p] Pause or resumes the motion of the plane. |
| 33 | * [mouse] Pitch/yaw. |
| 34 | |
| 35 | == The Car == |
| 36 | * [w/up arrow] Accelerate. |
| 37 | * [s/down arrow] Brake. |
| 38 | * [a/d, left/right arrows, mouse] Turn. |
| 39 | * [middle mouse button] Jump. It has hydraulics. |
| 40 | |
| 41 | == The Boat == |
| 42 | * [w/up arrow] Accelerate. |
| 43 | * [s/down arrow] Brake. |
| 44 | * [a/d, left/right arrows, mouse] Turn. |
| 45 | |
| 46 | == Walking == |
| 47 | * [w/up arrow] Move forward. |
| 48 | * [a/d, left/right arrows, mouse] Turn. |
| 49 | |
| 50 | == Environment Information == |
| 51 | This flight simulator takes plane around Cory Island, a C-shaped piece of |
| 52 | land named after its creator and containing everything he could fit on it in |
| 53 | a reasonable amount of time. |
| 54 | |
| 55 | The island is formed by combining several mathematical functions with the |
| 56 | midpoint subdivision algorithm to create its very specific shape while |
| 57 | containing randomly-generated mountains on a single heightmap. First, the |
| 58 | midpoint subdivision algorithm is performed on the left (looking at it as a |
| 59 | C) half of it. This is then tapered linearly down to the right half so that |
| 60 | there are no cliffs immediately adjacent to the flat part. The distance to a |
| 61 | circle of the desired size of the C is calculated at each point in the |
| 62 | heightmap, and it is raised up if it is determined to be on the C or clamped |
| 63 | to zero if it is not. It is slightly tapered if it is near the edge. |
| 64 | Finally, a small opening is cut out to make the "O" into a "C," again, |
| 65 | tapering it to make a smooth beach. This is the final form of the C. |
| 66 | |
| 67 | Surface normals are then estimated for each grid square on the height map, |
| 68 | and then these are averaged for each vertex, producing a smooth set of |
| 69 | normals to be used for lighting calculations. |
| 70 | |
| 71 | == Extensions == |
| 72 | * The addition of the car and boat as well as Mr. Egghead from project 2 are |
| 73 | extensions. |
| 74 | * If the plane crashes into the ground, water, or a building, it explodes. If |
| 75 | the car collides with a building or dives into water, it explodes. If the |
| 76 | boat hits land, it explodes. Mr. Egghead is invulnerable. |
| 77 | * When you crash, the camera goes into a special "explosion-vision" mode. Use |
| 78 | the 1-4 keys to go back to a normal mode. |
| 79 | * The car uses very simple physics to allow it to drive on sloped surfaces. |
| 80 | * The boat uses even simpler controls. |
| 81 | * Mr. Egghead is a simplified version of what I used for project 2. |
| 82 | * The trees are simple fractals. There are simple clouds in the sky. |
| 83 | * The water is animated. |
| 84 | * The plane has slightly more advanced (but still oversimplified) physics than |
| 85 | was required. It climbs less (or falls) when not oriented normally, for |
| 86 | instance. |
| 87 | |
| 88 | == Known Bugs == |
| 89 | * Lots of collisions aren't handled, and most that are should be handled |
| 90 | better. |
| 91 | * In extreme circumstances, the car noticably clips through the ground. |
| 92 | * Mr. Egghead moves faster when going uphill. |
| 93 | * The trees should be randomly generated. |
| 94 | * The boat should have a proper model. The airplane and car models are also |
| 95 | very bad. The textures are bad. |
| 96 | * The camera should be prevented from going inside of the ground and buildings. |
| 97 | * The car can drive in the air. |
| 98 | * You can see the seams in the sky box. |