void makeReflection(::arma::mat44 & matOut, const ::arma::vec3 & normal)
{
  // Using householder transformation.
  // See: http://en.wikipedia.org/wiki/Transformation_matrix#Reflection_2
  matOut.eye();
  matOut.submat(0, 0, 2, 2) = ::arma::eye< ::arma::mat>(3, 3) - 2.0 * normal * normal.t();
}
void makeZRotation(::arma::mat44 & matOut, const double angle)
{
  matOut.eye();
  matOut(0, 0) = cos(angle); matOut(0, 1) = -sin(angle);
  matOut(1, 0) = sin(angle); matOut(1, 1) = cos(angle);
}