Vectors
Vectors
Vectors
If you know what a point is, then a vector can be represented as a point in space that has a direction and a magnitude in relation to its origin.
If you know what a point is, then a vector can be represented as a point in space that has a direction and a magnitude in relation to its origin.
A point is very similar but doesn’t have this additional info.
A point is very similar but doesn’t have this additional info.
A vector has:
A vector has:
A direction, represented by the arrow
A direction, represented by the arrow
A magnitude, represented by the length of the line.
A magnitude, represented by the length of the line.
In this case, the vector’s origin is (0,0).
In this case, the vector’s origin is (0,0).
Vectors in Video Games
Vectors in Video Games
In video games, we use vectors to represent the velocity of players, but also to control where they are aiming, or what they can see (where they are facing).
In video games, we use vectors to represent the velocity of players, but also to control where they are aiming, or what they can see (where they are facing).
All of this with one vector.
All of this with one vector.
We also need a point to keep track of the player’s position at all times.
We also need a point to keep track of the player’s position at all times.