Unit 4 part 2 Flashcards
What does a 2D vector like (4, 2) represent in game development?
A. Only an object’s rotation
B. Either a position or a direction, depending on context
C. A game object’s material
D. Only a velocity
✅ Answer: B
How do you calculate the direction vector from point A to point B?
A. Add their coordinates
B. Multiply the points
C. Subtract A from B (B − A)
D. Use their average
✅ Answer: C
What is the result of subtracting A(5, 0, 10) from B(12, 0, 5)?
A. (17, 0, 15)
B. (5, 0, 5)
C. (7, 0, -5)
D. (-7, 0, 5)
✅ Answer: C
When you add two vectors A and B, what is the result?
A. Their average
B. A longer vector in a random direction
C. The shortest path between them (point A to C via B)
D. The sum of their magnitudes only
✅ Answer: C
What is the formula for the magnitude of a 3D vector (x, y, z)?
A. x + y + z
B. √(x² + y² + z²)
C. x² + y² + z²
D. √(x + y + z)
✅ Answer: B
Why do we normalize a movement vector in a game?
A. To round values
B. To maintain consistent speed in all directions
C. To slow the player down
D. To get rid of decimals
✅ Answer: B
What defines a unit vector?
A. A vector with equal x, y, and z values
B. A vector made with integers only
C. A vector with a magnitude of 1
D. A vector used for collisions only
✅ Answer: C
How do you normalize a vector?
A. Subtract it from itself
B. Multiply it by its magnitude
C. Divide each axis by the magnitude
D. Square each value
✅ Answer: C
What happens when you multiply a vector by a scalar value?
A. You rotate it
B. You increase its speed (magnitude)
C. It deletes the vector
D. It reverts to local space
✅ Answer: B
What does a negative scalar do when applied to a vector?
A. Has no effect
B. Inverts the vector’s direction
C. Resets the vector to (0, 0, 0)
D. Turns it into a string
✅ Answer: B
In movement logic, using a normalized vector with a scalar value allows you to:
A. Randomize movement direction
B. Control movement speed (e.g. walking vs running)
C. Ignore gravity
D. Cancel all input
✅ Answer: B
What does the dot product of two normalized vectors return?
A. A new vector
B. An object name
C. A number between -1 and 1
D. Always 1
✅ Answer: C
If the dot product is 1, what does that mean about two vectors?
A. They are perpendicular
B. They are facing opposite directions
C. They have the exact same direction
D. They point to different targets
✅ Answer: C
If the dot product of two normalized vectors is 0, what does it mean?
A. They are aligned
B. They point in opposite directions
C. They are perpendicular (90 degrees apart)
D. One of the vectors is invalid
✅ Answer: C
In enemy AI, how is the dot product used?
A. To determine the best pathfinding route
B. To detect player visibility based on direction
C. To draw the enemy model
D. To calculate score multipliers
✅ Answer: B
A character moves using this code:
Vector3 moveDir = new Vector3(1, 0, 1).normalized * speed;
What is the effect of calling .normalized here?**
A. It ensures the character always runs forward
B. It prevents vertical movement
C. It keeps the direction consistent while allowing speed to vary
D. It stops movement if the value is over 1
✅ Answer: C
Two enemies are checking if the player is directly in front of them using dot product. One returns 0.98, the other returns -0.92. What does this tell us?
A. Both enemies are looking at the player
B. The first is facing the player, the second is facing away
C. The second one is closer to the player
D. They are both perpendicular to the player
✅ Answer: B
A player’s direction is Vector3.forward and the enemy’s direction is Vector3.right. What will their dot product be (roughly)?
A. 1
B. 0
C. -1
D. 0.5
✅ Answer: B
Explanation: forward (0, 0, 1) and right (1, 0, 0) are perpendicular → dot = 0.