The landscape should be lit by one OpenGL distant light (simulating the sun or moon), and one ambient light (simulating bounce light and atmospheric scattering). For the lighting to work, you will need to compute surface normals at each vertex of your model. Compute these when you initially compute the landscape. The vertex normal should be the average of the normals for each face touching the vertex. Each face normal can be computed using the cross product of two of the edges on that face. Be careful to make sure your normals point up.
For user interaction, your program should support rotation exactly as shown in the sample program. To match rotations to mouse motion on the screen, it adds a rotation around an axis perpendicular to the mouse motion in screen space, before the current transform. You should also respond to several key presses. When space is pressed, you should generate a new random landscape with a different z offset in the noise function. For '+' and '-', you should increase / decrease the number of triangles by a factor of two, and simultaneously increase / decrease the octaves of noise by one. When any of '1' to '5' are pressed, you should select a set of pre-chosen values for z offset, +/- scale, and view that you think look particularly nice.
As always, there will be points for creativity, effort and realism.
Students registered for the 634 version of the course should make a multifractal landscape, with varying roughness at different points in the landscape. You may choose to vary the roughness based on whatever you like (altitude, slope, color code from an external file, or anything else that comes to mind).
Unfortunately, the only way to pass information between GLUT callback functions (the ones passed to GLUT through the glut*Func() calls) is by using global variables.
If you choose to code in C++, each of the GLUT callback functions must be a top-level function (not a class member function) declared extern "C". For example,
// declare extern "C" void draw(); // define extern "C" void draw() { // C++ code }
Also submit everything we need to run your submission. We should be able to run 'make' in your submission directory on the linux.gl systems to produce a running interactive OpenGL program. Submit your modified Makefile, any C/C++ files, and any other auxiliary files we might need. Be sure to comment your code! You will not be graded on the presence or quality of your comments, but we will look at your code and anything that helps us understand what you did (or were trying to do) can only help. In any case, your programs are expected to be robust and easy to understand.
If you have a X server on your home machine (i.e. if you are running Linux, Mac with X11, or one of the Windows X11 packages), it is possible to run remotely, though interacting with the application is much harder when displaying remotely.
If you absolutely must work at home, you will need:
All of these libraries are cross-platform and run on both Unix and Windows. However, if there are no pre-built binaries for your platform, you may end up having to build them from the source downloads. Which brings me back to: if you don't have to work at home, don't.