In this video, Freya Holmér introduces fundamental mathematical concepts for game development, focusing on vectors and the dot product. She covers the basics of 1D and 2D vectors, including operations like addition, subtraction, normalization, calculating length, distance, and positioning points along a direction. The video also touches upon the importance of math in game development, practical applications of these concepts, and provides assignments for viewers to practice.
In vector mathematics, "length" and "distance" are closely related but have slightly different applications:
Length (or Magnitude):
v with components (vx, vy) in 2D, the length is calculated using the Pythagorean theorem: sqrt(vx*vx + vy*vy). For a one-dimensional scalar value (like a single number), the length is simply its absolute value.Distance:
distance(A, B) = length(B - A).Vectors, as explained in the video, are mathematical objects that have both magnitude (length) and direction. They can be represented as arrows or as a list of components, with each component corresponding to a dimension (like x, y, or z).
Vectors are used for a wide range of purposes in game development, including:
The video distinguishes between scalars and vectors in the following ways:
Scalars:
Vectors:
(x, y) for 2D, (x, y, z) for 3D).(2, 3) could mean "move 2 units along the x-axis and 3 units along the y-axis."