Unit 4 part 2 Flashcards

1
Q

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

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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)

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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)

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

✅ Answer: C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

✅ Answer: B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

✅ Answer: C

17
Q

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

A

✅ Answer: B

18
Q

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

A

✅ Answer: B
Explanation: forward (0, 0, 1) and right (1, 0, 0) are perpendicular → dot = 0.