code: function makeLookAt(ex, ey, ez,
                      cx, cy, cz,
                      ux, uy, uz)
  {
      var eye = $V([ex, ey, ez]);
      var center = $V([cx, cy, cz]);
      var up = $V([ux, uy, uz]);
  
      var mag;
  
      var z = eye.subtract(center).toUnitVector();
      var x = up.cross(z).toUnitVector();
      var y = z.cross(x).toUnitVector();
  
      var m = $M([[x.e(1), x.e(2), x.e(3), 0],
                  [y.e(1), y.e(2), y.e(3), 0],
                  [z.e(1), z.e(2), z.e(3), 0],
                  [0, 0, 0, 1]]);
  
      var t = $M([[1, 0, 0, -ex],
                  [0, 1, 0, -ey],
                  [0, 0, 1, -ez],
                  [0, 0, 0, 1]]);
      return m.x(t);
  }
docs: gluLookAt