Fix bug for converting viewDir to spherical angles.