Write a simple flight simulator using WebGL to handle the display. Your "plane" will fly over the terrain you generated in the last MP. Add a cloud of fog to your terrain.
The airplane should automatically move forward at a fixed speed. The user will control the bank and tilt of the airplane through the arrow keys.
- Pressing the left (right) arrow key will make the plane roll to its left (right).
- Pressing the up (down) arrow key will cause the airplane to pitch up (down).
- Pressing the + (-) key will increase (decrease) the airplane's speed
You will need to implement the following
- A quaternion based viewing system.
Note: The glMatrix library provides support for using quaternions...and you should use it [link]. - A user interface that minimally implements the arrow-key and +/- key controls described above. You can add additional controls to affect yaw if you wish.
- Your webpage should include text instructions describing how the user interface works.
- A cloud of fog, placed over and around your terrain.
Note: The fog computation should be done per-pixel, which means implemented in the fragment shader. - Implement controls which turn the fog on and off in the scene.
- Commenting: You should comment each file with an author comment and comment each function you write with a header. Use JSDoc comments with the appropriate tags and types.
Details can be found in the Google JavaScript Style Guide.
Submission:
You will name the directory containing your work ${NetID}_MP2. Create a zipfile of this directory with name ${NetID}_MP2.zip, and upload it to compass. Include all of the files necessary for your application to run locally. Name your webpage Flight.html
Rubric:
Feature | Points | Description |
---|---|---|
Documented and interactive UI | 1pt | Using keyboard or mouse to control your plane interactively and your user interface explained on your webpage |
Translation | 1pt | The plane should move forward automatically. |
Roll | 1pt | Apply correct rotation when your plane rolls left or right. |
Pitch | 1pt | Apply correct rotation when your plane pitch up and down. |
Speed | 1pt | Include the ability to speed up and slow down the plane |
Fog | 1pt | Include a layer of fog over and around the terrain |