After reading google, I still don't quite understand what this does/means? Could someone explain this? Possibly a simple example? Thank you very much.
A:
Normalizing a vector scales it to length 1.0, without changing its direction.
Edit: This works by finding the length of the vector and then dividing each of the co-ordinates by the length:
length = sqrt(x*x + y*y + z*z);
norm = [ x / length, y / length, z / length];
Clearly you cannot normalize a zero-length vector.
Jackson Pope
2010-10-20 10:07:17
Making it a 'unit vector', good for all kinds of interesting calculations.
Emiel
2010-10-20 10:08:09
What is this unit vector? what makes it different compared to a normal vector?
RoR
2010-10-22 03:37:33
A unit vector is any vector of length 1.
Jackson Pope
2010-10-22 06:53:05
+4
A:
Normalizing a vector means changing its components so its total length is equal to 1.
In pseudo-code:
length = sqrt((vec.x * vec.x) + (vec.y * vec.y) + (vec.y * vec.y))
vec.x /= length
vec.y /= length
vec.z /= length
This has many uses in real-time 3D, as normed vectors have interesting properties.
jv42
2010-10-20 10:18:38