CMPS 160, Spring 2007
Programming Assignment 4
Due Midnight
Thursday May 23, 2007
Objectives
- Learn how to use Lighting,
Shading, and Tessellation.
Assignment
Required Part:
- Add a light source in your
scene and specify the lighting/material properties
- Tessellate the polygons that make
up the countries.
- Allow the user to:
- Switch between
WIREFRAME / FILL modes
- Enable / Disable
Lighting.
- Change Shading (FLAT /
SMOOTH)
- As before, translate
and rotate the surface using a virtual trackball or clicking and dragging.
Getting Started:
- This assignment will build up
on the previous assignment. You will reuse most part of your code in the
third assignment.
- As you noticed, the
polygons were not filled in the third assignment due to being no-planar. In this
assignment you will need to use tessellation to allow drawing of filled polygons.
- In this assignment you will need to
use Lighting and Shading while drawing polygons.
- You will need to compute
normals for every polygon you render in your globe and also specify the
shading model.
-
Here is some initialization code
that will help you get started.
-
Here is some template code
that will help you get started.
Extra Credit Part:
- Allow the user to:
- Add more light
sources.
- Translate / Rotate
light sources.
- Allow the user to
change light / material properties (changing color, shininess etc.).
How to submit
·
To submit the program log on to one of the CATS
systems (unix, teach, learn, hawking, etc.) and type
% submit cmps160-skl.s07 prog4 file1 file2 ...
·
To check what you submitted type
% peek cmps160-skl.s07 prog4
·
What to submit
1. All
source/header files used
2. The
Makefile.
3. A
README file that explains your program in brief. The README is not a substitute
for source documentation. Please make sure that your code is appropriately
documented and indented.
What to study:
·
In the Red Book, read the sections in Chapter 3
on Viewing and Modeling Transformations, Chapter 5 on Lighting.
If you have any questions regarding the programming
assignment, please contact Jacob Telleen
with a CC to Suresh Lodha.