Definition
- Translation moves every point of an object a constant distance in a specified direction.
- It is represented by adding the translation vector to the position vectors of the object’s points.
Example of a Translation Matrix:
Scenario 1: Moving an Object Upwards in the Y-Axis
Imagine we have a game object initially located at the coordinates (2, 3, 4) in a 3D game world. We want to move this object 5 units upwards along the Y-axis.
- Translation Vector: , ,
- Initial Position Vector:
Translation Operation: To calculate the new position, we apply the translation matrix to the object’s initial position vector:
New Position:
Scenario 2: Moving an Object Along All Axes
For a more complex example, imagine we want to move the same game object from its initial position to a new position by translating it 3 units along the X-axis, 5 units along the Y-axis, and 2 units along the Z-axis.
- Translation Vector: , ,
- Initial Position Vector:
Translation Operation: Applying the translation matrix to the object’s initial position vector, with our specific , , and values:
New Position: