Zbynek Dusatko's Lab / Homework 6 Writeup

Overview

Sixth lab was getting acquainted with the material colors and lighting.

Description

This is to suppose to simulate a steam engine. I used two lights, point and spot ones. Most of the materials I used I found online in OpenGL references. The materials I used were to simulate brass (cog-wheels and part of the piston), bronze (boiler) black iron (boiler base, spike-wheel) and polished metal (part of the piston). The most difficult part was to synchronize the movements. I did it just by manually adjusting the variables and synchronization goes off after some time. There is probably a better way. GLMaterial and GLLight classes seem to follow the same pattern as GLTransform class, using pseudoconstructors to setup material colors and lights. LightManager class then is just interface for GLLight objects. Scene class then creates a dictionary of transforms and materials and LightManager object, and this again contains a dictionary of lights. Dictionaries contain pointers so the content can be changed anywhere in the program.

Screenshot(s)

Here is the shot I've taken (2.72 MB).

steam engine

steam engine