Introduction to Computer Graphics Logo
CSU Logo

Here are nine examples illustrating various aspects of illumination in OpenGL.

  1. exampleSphere01.cpp Grey sphere, one light.
  2. exampleSphere02.cpp Same sphere, ambient only (flat).
  3. exampleSphere03.cpp Same sphere, ambient and difffuse only.
  4. exampleSphere04.cpp Same as example 1, but brighter material.
  5. exampleSphere05.cpp Same as example 4, but material is green.
  6. exampleSphere06.cpp Example 4 with green and red light.
  7. exampleSphere07.cpp Brass Sphere.
  8. exampleFace01.cpp Green and red light shining on white face.
  9. exampleFace02.cpp Face with attenuation, added ambient white.

The code is also available with a makefile in tar and zip files

Here is what the examples look like, although recall these all have navigation which lets you change the viewpoint.