Due: 11:59pm CDT, October 26, 2018
For the second part of Machine Problem 2, you will 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.
Flight and Fog
The airplane should automatically move forward at a fixed speed. The user will control the pitch and roll of the airplane through the arrow keys. This video explains airplane motion.
- 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. This tutorial should help with implementing fog (you'll have to modify some code from the tutorial).
Note: The fog computation should be done per-vertex, which means implemented in the vertex shader.
- Implement controls which turn the fog on and off in the scene.
Grading
Name your submission as ${NetID}_MP2B.zip and submit it to Compass. Include all of the files necessary for your application to run locally (this includes gl-matrix-min.js and webgl-utils.js).
The assignment will be graded based on the following scale:
- 1 pts - Documented and interactive UI: Using keyboard or mouse to control your plane interactively and your user interface explained on your webpage
- 1 pts - Translation: The plane should move forward automatically.
- 1 pts - Roll: Apply correct rotation when your plane rolls left or right..
- 1 pts - Pitch : Apply correct rotation when your plane pitch up and down.
- 1 pts - Speed: Include the ability to speed up and slow down the plane.
- 1 pts - Fog: Include a layer of fog over and around the terrain (and a way to turn the fog off and on).