CS 770/870
Assignment 3. Basic Lighting and Textures

Purpose: learn some openGL lighting and create a simpler more useable interface to it. Also do some elementary 2D texture mapping

Your class should impose constraints on both the lighting direction and the various components of the and surface model lighting model.

The following methods must be implemented.
lightAndColor.setDirection(elevation, azimuth); // angles in degrees [0-90, +/-90]
lightAndColor.setAmbient(a); // parm between 0 and 1.0;  Internally max is 50% (relative to lambertian)
lightAndColor.setColor(R,G,B); // the red, green and blue components of the surface (between 0 and 1.0)
lightAndColor.setGloss (shininess, amount);  //parms  between 0 and 1. Default for shininess, exponent = 30 [range 20-100] Default for amount 15% [min=0, max = 40%].

Internally your software should ensure that the red, green and blue values do not oversaturate too much. Also the lighting will always be from behind and above the viewpoint. You can allow specular to oversaturated, but only by 20%.

Your progam should do the following

Have a checkerboard plane   100x100 meters in size. Dark grey and blue colors. The checkerboard will be created using a texture.
On this place 8 spheres, each 20 m diameter. 2 rows of 4.
Rows ( Light medium and dark variants of the colors red, green, yellow and blue) Columns (high gloss, matt).

Also on the checkerboard place a cube OR a cylinder.  Each will have images of planet earth mapped onto them, using ALL surfaces and be properly shaded.
Make the whole scene rotate smoothly about a vertical axis.  The Earth object should indepenently rotate about two axes.

Your program should NOT use glColorMaterial. It will only assume a single light source + ambient.

More details to be supplied in class.

Due: 17 Oct by email (cware@ccom.unh.edu)

Deliverables: source code in a single file

A description of how the color and light scaling is accomplished to achieve the assignment objectives. This should succinctly describe the equations defining what you have implemented.