@Didier This is a good question for you :
I am trying to figure out the math to project a vector that represents my player movement direction from a top view ( Fig. 1 ) on to a plane which that is represented by a normal vector ( Fig. 2 ). The movement direction vector is calculated from the top view and doesn’t have any Z ( up/down ) component to it. I am using Bullet to get the normal of the surface that my player is walking on ( represented by the blue lines in Fig. 2 ) and I want to take my movement direction vector ( A ) and line it up with the surface like vector B in Fig. 3.
Fig. 1: Top View Movement Direction Vector
Fig. 2: Ground Normal Vector
Fig. 3: The Goal is Alignment of Movement Vector With Ground Surface