Game Development Reference
2.3.3 Translation, Rotation, and Scaling
Three transformations can be performed on an object whether it be in 2D
or 3D: translation, rotation, and scaling.
Translation refers to moving an object and is specified by a vector in the same
way the pirate in the previous section moved across the island. A translation
occurs whenever the x , y , or z values of an object are modified. They can be
modified all at once with a vector or one at a time. To move an object in the x
this.transform.position.x += 5;
could be written:
this.transform.position.x += 3;
this.transform.position.y += 5;
this.transform.position.z += 8;
Several examples of the Translate function are shown in Figure 2.13 .
Fig 2.13 Using the Translate function to modify the position of a game object.