What is a 3D vector and how does it differ from a 3D point?

Is a three-dimensional vector different from a three-dimensional point set (x, y, z) in the context of mathematics of 3D games?

If they are different, then how to calculate the vector given by a three-dimensional point?

+11
math vector 3d vertices
source share
7 answers

The difference is that the vector is an algebraic object that may or may not be specified as a set of coordinates in some space. (thanks bungalobill for correcting my sloppiness).

A point is just a point given by coordinates. As a rule, you can combine the two. If you are given a set of coordinates and are told that they make up a “point” without additional information (base selection, etc.), you can simply transfer this set of numbers back and legitimately state that you have created a vector.

The biggest difference between the two is that it makes no sense to do what you can do with another. For example,

  • You can add vectors: <1 2 3> + <3 2 1> = <4 4 4>
  • You can multiply (or scale) a vector by a number (usually called a scalar) 2 * <1 1 1> = <2 2 2>

  • You may ask how far two points are from each other: d ((1, 2, 3), (3, 2, 1) = sqrt ((1 - 3) 2 + (2 - 2) 2 + (3 - 1 ) 2 ) = sqrt (8) ~ = 2.82

A good intuitive way to think about the association between a vector and a point is that the vector tells you how to get from the origin (that is, one point in space to which we assign the coordinates (0, 0, 0)) to its connected point.

If you translate your coordinate system, you will get a new vector for the same point. Although the coordinates that make up this point will go through the same translation, so there should be a fairly simple connection between them.

Similarly, if you rotate the coordinate system or apply some other transformation (for example, a shift), then the coordinates and the vector associated with the point will also change.

It is also possible that the vector is something else entirely, for example, a bounded function on the interval [0, 1] is a vector, because you can multiply it by a real number and add it to another function on the interval and it satisfies certain requirements (namely axioms of the vector of space). In this case, we think about the presence of one coordinate for each real number x in [0, 1], where the value of this coordinate is f (x). So, this is the simplest example of an infinite-dimensional vector space.

There are all kinds of vector spaces and the concept that the vector is a “point and direction” (or that it should be) is actually quite empty.

+14
source share

A vector is a transition from one state to another. To create one, you need two states (in this case, points), and then subtract the initial state from the final state to get the resulting vector.

+2
source share

Vectors are a more general idea that a point is in three-dimensional space.

Vectors can have 2, 3 or n dimensions. They represent many quantities in the physical world (for example, speed, force, acceleration), except for the position.

The mathematician will say that the vector is a first-order tensor that transforms according to this rule:

u(i) = A(i, j)v(j) 

You need both a dot and a vector, because they are different. A point in three-dimensional space denoting a position is a vector, but each vector is not a point in three-dimensional space.

Then there is an idea of ​​the informational value of a vector as a container - this is an abstraction for an array of values ​​or links. This is a different concept from the mathematical idea of ​​a vector, since each vector container should not obey the first-order tensor transformation law (for example, Vector of OrderItems). This is another separate idea.

It is important to keep this in mind when it comes to vectors and points.

+2
source share

Is a three-dimensional vector different from a three-dimensional point set (x, y, z) in the context of mathematics of 3D games?

A traditional vector means direction and speed. A point can be considered a vector from the world of the orgine of one time step. (although it cannot be considered mathematically pure)

If they are different, then how to calculate the vector given by a three-dimensional point?

target-tower - general mnemonics.

Caution about this. The resulting vector is really normal * speed. If you want to change it to something useful in a game application: first you need to normalize the vector first.

Example: Joe is at (10,0,0) and he wants to go (10,10,0)
Target tower: (10,10,0) - (10,0,0) = (0,10,0)
Normalize the resulting vector: (0,1,0)
Apply "physics": (0,1,0) * speed * elapsed_time <speed = 3, and we will say that the computer froze as much as 2 seconds between the last step and this, for the convenience of calculations> = (0,6,0)
Add the resulting vector to the current Jos point in space to get the next point in space: ... = (10,6,0)

Normal = vector / (sqrt (x * x + y * y + z * z))

... I think I have everything here.

+1
source share

A vector is a change of state. Point is a static point. Two vectors can be parallel or perpendicular. You can get the product of two vectors, which is the third vector. You can multiply a vector by a constant. You can add two vectors.
All these operations are not allowed. Thus, programmatic wise, if you think that and as a C ++ class, there will be many such methods in a vector class, but probably only Get and Set for point.

-one
source share

A vector is a string, that is, a sequence of points, but it can be represented by two points, a start and an end point.

If you take the origin as the starting point, then you can describe your vector, giving only the end point.

-2
source share

In the context of game math, there is no difference.

Points are elements of the affine space. Vectors are elements of vector (linear) space. When you select a source in an affine space, it automatically creates a linear structure in that affine space. the converse is also true: if you have a vector space, it already satisfies all the axioms of an affine space.

The fact is that when it comes to computing, the only way to numerically represent an affine space is to use tuples of numbers, which also form a vector space.

Each object in the game always has an origin, and it is very important to know where it is. This source is relative to the origin of the world, which is relative to the source of the camera / viewing area. The vertices of the object are represented as vectors - offsets from the origin of the object. You use matrix multiplication to transform objects - this is too pure an operation of vector space (you cannot multiply an affine point by a matrix without first specifying the source). Etc., Etc. As we can see, all these triples of numbers, which we can consider “points”, are actually vectors in the local coordinate system.

So is there any reason to distinguish these two from the study of algebra? This is an unnecessary abstraction, and unnecessary abstractions are harmful (KISS). So my answer is no, just select one vector type.

Or any topological space outside the context of game development.

-2
source share

All Articles