CS 480 - Program #
4 - Due: 4/19/02
Assignment:
Write a C++ program that employs the OpenGL API to display a view
of three 3-D objects on screen, and has the ability to turn on
different colored lights based on user selections from a menu
attached to the right mouse button.
Starting Point:
Copy the file P4START.CPP from the following path on the SHARED
network drive: M:\CSIS\CINDRICBB\HANDOUT\CS480\PROG4.
Use this file as the starting .cpp file for your Visual C++
Win32 Console Application project for this assignment.
3-D Objects:
Display three different 3-D objects (tetrahedra, squares, rectangular
solids, spheres, etc.) on the screen. The viewing volume
established in the starting code is looking at the origin from
a height above the y=0 plane, so you should be able to
place your objects near the origin and have them be visible when
the scene is rendered.
The objects should have the following material properties: 100%
values for all colors for diffuse and specular reflection, 0% for
all colors for emissive and ambient reflection, and a shininess
of 100. Set the material properties at the beginning of
your display callback function, before drawing your objects.
Menu selections and Lighting values:
There is one light source defined in the starter code: GL_LIGHT0
should be used to set the qualities of the light. Initially,
the light should be WHITE for the diffuse and specular components,
and BLACK for ambient. Don't change the location of the
light source in your program.
There should be a menu attached to the right mouse button that
allows the user to select RED, GREEN or BLUE diffuse light.
If the user selects RED, the diffuse color should be RED and the
specular color should be BLUE. If the user selects GREEN, the diffuse color should be GREEN and the
specular color should be RED. If the user selects BLUE, the diffuse color should be BLUE and the
specular color should be WHITE. You may refer to the demo
program located at THIS LINK for
help with this assignment.