I want to know how to “normalize” a direction based on a ray and the position that the ray hit.
sorry if my vocabulary is wrong I’m not very experienced in advanced vector math
I am attempting to make a wall running system, and for my math involved in calculating where the player should be next along the wall I have run into a problem that I believe can be solved with either dot product or cross product but I’m not sure specifically how to apply either of those.
I’ll explain how my wall running system works:
First, there is a ray that is created to detect if there is a wall to run on. This would be represented as a
in this diagram:
Second, if a wall is found, I want to use the b
direction to find where in relation to the wall that was hit that the player should start wall running at.
This would work because I could scale the B direction to be as far away from the wall as I wanted, and it would theoretically work anywhere along the curve, or anywhere on a flat surface.
My problem is that I can’t figure out how to get said b
direction. I looked into cross product and dot product, and I saw in a post by sleitnick how to get a c
direction:
But, I couldn’t figure out how to get b
which would be inbetween both of these.
I’ve tried to use the Normal that is returned by the ray that is a
, but I don’t believe that this will work in my scenario, unless I am applying the normal incorrectly. Any help is appreciated.