Answers for "Vector normalization question"
http://answers.unity.com/questions/52881/vector-normalization-question.html
The latest answers for the question "Vector normalization question"Answer by toddisarockstar
http://answers.unity.com/answers/1354823/view.html
here is the most simple way to explain for new people! and with the simplest math!
if you have two different positions represented in three numbers (vector3).
and if you simply subtract one vector3 from the other. The difference you get can simply be added back to any other vector3 position to move it the same distance and direction.
that part is so simple unity doesnt even have a function for it.
so now with this new magical number from a simple subtraction of two points. you can hold it to calculate out a distance or a rotation or a direction in space. and one thing you other guys forgot to mention is that if you do this simple subtraction used more than once over time can also be used to calculate speed between to points! so this simple subtraction is a very important concept for all here to understand!
normalizing this number is a calculation similar to dividing the three vector numbers down evenly until the points where only 1 square away in the same direction. normalizing is actually an algorithm that uses square roots as described in the answers above. normalizing is helpful if you wanted to move an object slowly every frame in that direction at a consistent speed.Thu, 18 May 2017 02:45:39 GMTtoddisarockstarAnswer by biebuster
http://answers.unity.com/answers/1076135/view.html
Alright let's say that we want to find the normalized version of (2, 4, 0)
First just to clear up any confussion: the magnitude (or length!) is:
//The square root of: x * x + y * y + z * z
Now when we normalize something, that magnitude needs to be 1. Alright now for the actual explanation.
So first of all let's find out how we find the direction. imagine we have a vector called: 0, 4, 0. you have this cordinate system here:
http://i.imgur.com/pUp8SX3.png
So bassicly we're taking our vector and comparing it to the absoloute 0, 0, 0, place of our coordinate.
And in our case, compared to our vector of 0, 4, 0 the direction only goes upwards. That's why the direction then ends up being 0, 1, 0
0, 4, 0 direction = 0, 1, 0;
Now if it was 0, 2, 0, this would happen:
http://imgur.com/GPhlI4w
Aright let's take a vector that has these values: 4, 4, 0;
if we had a vector with 4, 4, 0
then this would happen:
http://i.imgur.com/BX1CCNR.png
In this case you'd be able to have any values at x, and y, AND if those values were excatly the same it would give: 1, 1, 0
4, 4, 0 direction = 1, 1, 0
finally let's take our 2, 4, 0 vector.
http://i.imgur.com/xNM4JNG.png
2, 4, 0 direction = 1, 2, 0;
But what does this have to do with normalization? well let's take the 3 direction vectors we had before:
4, 4, 0 direction = 1, 1, 0;
0, 4, 0 direction = 0, 1, 0;
2, 4, 0 direction = 1, 2, 0;
When we want the normalization we want the magnitude of these values. So let's find the magnitude here:
//1, 1, 0 magnitude = square root of: 1 * 1 + 1 * 1 = 1.41;
//0, 1, 0 magnitude = square root of: 1 * 1 = 1;
//1, 2, 0 magnitude = square root of: 1 * 1 + 2 * 2 = 2.23;
0, 1, 0 doesn't need to be normalized cause it's magnitude is 1! perfect!
1, 1, 0 however needs to be normalized. And sadly the only way to do this is just let a computer divide it by what makes it go down to 1. Not something we would easily be able to calculate. Same goes for 1, 2, 0
And that is that! I know this comment is from 2011, but this answer was mostly made to help people like me who really strucled with it, even after reading these other answers, and the unity documentation.
or it's just 1 hour of my life wasted
have a good daySun, 04 Oct 2015 12:41:48 GMTbiebusterAnswer by sparkzbarca
http://answers.unity.com/answers/410307/view.html
a normalized vector is the slope of the line on which the vector lies (of course this is only useful if the vector represents a line more commonly referred to as a direction)
knowing the slope of a line is useful a lot so it's a common operation.Mon, 04 Mar 2013 03:36:57 GMTsparkzbarcaAnswer by Owen-Reynolds
http://answers.unity.com/answers/53045/view.html
<p>A use for normalize:</p>
<pre><code>// bullet is speed 5, aimed at timmy:
float3 v = ((timmy.transform.position - transform.position).Normalized)*5;
bullet.velocity = v;
</code></pre>
<p>The Normalized converts the gap between timmy and myself to length 1, and the *5 gives the bullet a speed of 5.</p>
<p><code>bullet.LookAt("timmy"); bullet.rigidbody.velocity = bullet.forward*5;</code> is the more common way (in Unity) of doing it. Normalized is often used for the oddball "I have the right direction, but it's the wrong length" problems, or when you can't use LookAt.</p>Fri, 18 Mar 2011 16:22:32 GMTOwen-ReynoldsAnswer by Eric5h5
http://answers.unity.com/answers/52885/view.html
<p>A vector is either a point, or a direction. See the Ray struct, for example. It's two Vector3s, and the first Vector3 is the origin and the second Vector3 is the direction. If it's a direction, then it has a length. Vector3(0, 0, 5) is a direction of 5 units along the z axis, so it has a length of 5. If you normalize that, it's Vector3(0, 0, 1). You would do this when you only want the direction and don't care about the length.</p>Thu, 17 Mar 2011 18:52:05 GMTEric5h5Answer by flaviusxvii
http://answers.unity.com/answers/52882/view.html
<p>A vector exists in a vector space, which has an origin. So every "point" is a line from the origin to that point.</p>
<p>The vector [1, 1, 1] is a line from [0, 0, 0] to [1, 1, 1].</p>
<p>Normalizing a vector preserves the direction, but moves the point to exactly one unit from the origin.</p>Thu, 17 Mar 2011 18:29:40 GMTflaviusxvii