Comments and answers for "How to use dot product return value"
http://answers.unity.com/questions/767136/a-problem-with-dot-product.html
The latest comments and answers for the question "How to use dot product return value"Comment by robertbu on robertbu's answer
http://answers.unity.com/comments/767345/view.html
Vector3.Angle() is in degrees so to map between -1 and 1 it would be:
Vector3.Angle(refVector, vector) / -90.0 + 1.0;Sat, 09 Aug 2014 08:44:24 GMTrobertbuComment by aosome23 on aosome23's answer
http://answers.unity.com/comments/767210/view.html
Wait nevermind... would (pi/2 - Vector3.angle) / (pi/2) work?Sat, 09 Aug 2014 01:00:39 GMTaosome23Comment by aosome23 on aosome23's answer
http://answers.unity.com/comments/767200/view.html
Wait, but how would you go from angle to a value that goes between 1 and -1?Sat, 09 Aug 2014 00:53:55 GMTaosome23Comment by Kiwasi on Kiwasi's answer
http://answers.unity.com/comments/767189/view.html
Consider going straight to Vector3.Angle This does all the same calculations for you.Sat, 09 Aug 2014 00:34:18 GMTKiwasiAnswer by Bunny83
http://answers.unity.com/answers/767152/view.html
Sure, what the dot product of two normalized vectors returns is the cosine between those two angles. What you want is the angle, so all you need to do is to take the arccos of that value to get the angle in radians. To get a value between 0 and 1 you just need to divide by PI. So 0 is 0° and 1 is 180° 0.5 is 90°
float v = Mathf.Acos(dot) / Mathf.PI;Fri, 08 Aug 2014 23:09:13 GMTBunny83