OpenGL Lighting

WARNING: The timer function sometimes returns only negative values leading the sphere not to jump up and down properly. You may want to fix this first.

TODO: With this code you can learn a lot about lighting and materials. Here are some ideas for you to experiment with.

  • Make at least 3 sphere jump up and down
  • Make a directional and a positional light source
  • Find out about spotlights in OpenGL and implement one of those
  • Let the spotlight jump up and down as well
  • Experiment with material properties. Make one sphere that's metallic looking.
  • Do some physics. Let the spheres have some acceleration.
  • Squish the spheres when they hit the ground. Make sure to take care of the normals when scaling!

If you did something cool, send me the code and I'll make a best-of presentation in one of the labs.