I was watching a tutorial about Vectors in Unity, I understood the meaning of normalizing a vector but I wanna know why do we normalize a vector and if we don't what will happen ?
There are reasons someone might want to normalise a Vector, including dealing with directions. Normals on meshes, for example, are normalised, because you only care about their direction, not their length.
It also makes the math work, because if you have multiple normal vectors with different lengths, it would be impossible to calculate values (like lighting) in a uniform way.
There are operations that do not make sense when the vector is not normalized. Some examples:
- When you want to get the projection of a vector on another vector. You want to normalize the second one so that you only get its direction.
- When you are dealing with basis vectors in a Cartesian coordinate system. This is where matrix transformations and viewing in 3D space comes into play.
There are a lot more, but this is the gist of it.