Added a texture map for testing the unwrap on the mesh. Turns out we need to turn on Normalized Texture Coordinates for manually created UV's (from MAX), while the UV's on standard boxes and spheres from MAX are good.
Also, disabled applying the model and mesh transform in the drawModel function because otherwise the calibration doesn't work: the manipulated 3D points end up in a different spot than the mesh that is drawn. Probably this is because the original code assumes a single mesh with no transforms applied. A solution would be to apply the matrices to the points in the modelPoints list, then stuff should be in sync again.