Projections onto subspaces with orthonormal bases