MP2 Part 1: Terrain Generation

Due: March 6 at 11:55pm

 

  
 

Write code to generate a piece of terrain using the Diamond Square algorithm. For now, this can be a static scene. We will add interaction in the second part of the MP.

You will need to implement the following

  1. Implement the diamond-square algorithm terrain generation algorithm. 
  2. Implement the Blinn-Phong illumination model and Phong shading. This means your shading calculations should be done per-fragment...meaning in the fragment shader.
  3. You can position your light source(s) anywhere in the scene as long as the rendered images are well-lit.
  4. You should shade the terrain using a colormap related to the height of the vertex. For example...your colors could go from blue to green to brown to white as in the image above. But please...be creative and don't feel you have to mimic the colormap used here. Also, the above image implements fog which you don't need to do... yet... so don't try to match it exactly
  5. 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 upload your files to compass in a zipped folder with name <NetID>_MP2A.zip. where <NetID> is rep[laced by your netid. Include all of the files necessary for your application to run locally. Name your webpage Flight.html

Rubric:

Feature Points Description
Terrain Generation 4pts Generate a finite mesh of triangles that resembles a terrain
Lighting 3pt Implement Blinn-Phong illumination and Phong shading correctly.
Performance  1pt Your code should be reasonably efficient.
Documentation  1pt Your code should be commented