Random Terrain Generation and Flight Sim

Controls: W or Up Arrow to pitch up. S or Down Arrow to pitch down. A or Left Arrow to roll left. D or Right Arrow to roll right. + and - to increase and decrease speed. Refresh page to generate new terrain.

The terrain is generated using an algorithm called the Diamond Square Algorithm. The movement of the camera in the 3D space is done by manipulating the parameters for WebGL's lookat() function. Fog is implemented in the GLSL fragment shader by using the distance of the fragment from the viewplane. Shaded using the Blinn-Phong illumination method, and Gouraud Shading for better performance.