can someone explain to me not in "mathematical terms" but in practice, that is, the application of a vector in a 2D plane for video game development? Because until now I had the belief that a vector was generally a point, that is, the tail of the vector taken as a reference on the 2D plane of a game engine, plus the displacement from this point. So a game object traveling the distance or magnitude(amount by which the game object moves) of the vector arrives at what should be considered "the destination" which should be the tip of the vector. Now I want to ask, is this the concept that applies in a 2D plane for a game engine? Because in a way, I am trying my hand at Godot engine, but from what I have seen, the documentation already considers any point in the 2D plane as a vector and not as I have on written i.e. a point plus displacement. Please if someone can explain to me concisely, because I want to have in practice the concept of vector clearly in mind so that I can move forward in development
1 Answers
So, how about scalar?
For example...
double x = 10; //x is scalar
double angle = 1.32; //angle is scalar
double dx = cos( angle ); //dx is scalar
x += dx;
where, x
means position, but angle
and dx
are not position.
angle
means direction, and dx
means delta value.
All of them are scalars, but they have different meanings. There is no rule as "scalar variable always expresses a particular meaning".
This point is same even if you use 2D vector.
2D vector is, so to speak, a collection of two scalars. It could be used to represent any two-dimensional quantity( position, velocity, acceleration, etc...).
Or... If talk about "displacement" and "point"...
If you consider vector as "displacement"... you can consider point(position) is also displacement "from origin".
When thinking about game object move, the displacement is "from current position of the game object".
Here, the vector only has the displacement amount and no information about "from somewhere".

- 1,370
- 2
- 7