Raw code from Lecture 8.

Implement reading a Mesh from .OBJ file.
Implement bump-mapping for meshes.
Change the default scene to 'testmesh.trinity', where we have a
textured dye with a bump map.

The code here is kinda unpolished right now, needs some reorganization
and comments.
Add comments to the new code.
Fix ParsedBlock::requiredProp()

This fixes the hiccup in the video to lecture 8
(https://vimeo.com/80786651) at 45:24. The code in requiredProp() calls
a SyntaxError constructor. However, there are two SyntaxError constructors,
one is SyntaxError(int, const char*, const char*), and the other one is
SyntaxError(int, const char*, ...). The intended one to be called is the
second one, but the first is called instead, as it is more specific.

The ambiguity is resolved by removing the first constructor, as it hasn't
actually been used anywhere.
Replace the code in fileExists() with a more generic version.

The old code just fopen()ed the given parameter, which apparently
doesn't work for directories, under Win32. So this should fix
the crash that happens there.
Fix the blackened seams on the top side of the cube.

The normals there are perturbed by the bump map and happen to
create "impossible" angles between the lightDir and the normal
(more than 90 degrees, so the cos() term becomes negative).

To cater for that, don't allow a negative light contribution in the
equations.
Prepare for lecture 9.
Fix some normal issues with the Heighfield.

Also, apply the solution to homework 6 / task 1: fix normals
for transforms, that contain scaling.
Raw code written during lecture 9. Implement K-d tree for Meshes.

Unpolished right now. To be beautified in a subsequent commit.
Modify scenes to display (and take advantage) of the KDTree.
Add comments to new code (mostly KDTree-related).
Fix a memory leak in Mesh: we didn't delete the KDTree when done.
Fix valgrind warnings.

- always initialize the bumpmap to NULL in Node.
- generate dNdx / dNdy for Plane, Sphere and Cube.
Beautification: No need to use pointers to KDTreeNode in build()/intersectKD().

References are just fine, we don't do anything that really requires pointers.
Add new source files to .cbp projects.
When the mesh has no normals in the .OBJ file, make up some.

If an .OBJ file has no "vn" lines, no per-vertex normals will be
available, and only gnormals of triangles can be used in shading.
This implies that the mesh will always be faceted. We can, however,
generate some normals, by finding the incident triangles to each
vertex, and averaging their gnormals.

Added a parameter, autoSmooth, which controls whether this step
is desirable.
Slight renaming in Mesh::loadFromOBJ.
Data files and test scenes for Homework 9.

Group 0: Use axe_test.trinity
Group 1: Use dragon.trinity
Group 2: Use nonconvex.trinity
Fix some bugs in heightfield.
Fix a regression in BBox::intersectTriangle.
Add the code from lecture 10

* Light interface
* Rectangle and point lights
* Depth-of-field support

All old scenes are incompatible, because we no longer have a single global light.
Only two scenes are converted at the moment.

More to come in a subsequent commit.
Ditto for comments and beautification.