Why do they always have the same result?

The dot product of “In vector” with “normal vector”, and “Out vector” with “normal vector”.
They always return the same result.
I want to make’em have the positive or negative results by the direction.

I don’t understand what the problem is from your description.

In the illustration, FVector::DotProduct(Normal, Out) will be a positive value, and FVector::DotProduct(Normal, In) will be a negative value.

If you believe you are seeing something else, then either the values of In, Out, or Normal are not what you expect them to be (check with the debugger!) or you are trying to compare vectors that are defined in different coordinate spaces than you expect (check the values in the debugger!)

Dot product tells you the angle between the vectors. Here’s it’s the same for both.

Small nit: Dot products have nothing directly to do with angles. Dot product returns the projection of one vector onto the basis of the other vector, scaled by the length of the other vector.

IF both vectors are normalized before dotting, AND you then call arc-cos on the value, then you get one of the two possible angles between the vectors in the plane shared by those vectors. This is almost never what you want to do, though – thinking of vectors as “angles” will lead you wrong-and-expensive more often that it will lead you right. The only case where you want angles, is when interacting with users in terms of angles, which comes up both in places like animation (tools,) and in places like compass headings.

2 Likes