fixed an bug: used wrong direction vector (unnormalized one) for projection