Translation, Rotation and Scale
Translation Rotation and Scale
The three most commonly used transformations to an object are translation rotation and scale. This section will look in detail at how these work.
Translation
Translation is handled using the move function
The object translates the object by vector
If you want to specify a absolute location for an object you can do so through its position property:
Scale
An object can be scaled in the same way that it can be moved. call the scale function with the object and the vector to indicate how much to scale along each axis
To do absolute scaling:
Rotate
There are also multiple modes of representing a rotation. This section looks at how rotations are represented.
Angle axis
Angle axis rotation states the rotation as an angle around a vector.
Imagine the vector as an axle that your object spins around. The axis runs through your object's pivot. The rotation then spins the object around the axle for the amount specified by the angle.
Angle axis requires specifying both the angle to spin and the vector to spin around. For example:
the above will rotate c around the x axis for 60 degrees clockwise when viewed in the same direction as the vector for rotation.
Quaternions
Quaternions - holds rotations and a set of operations
Like angle axis, quaternions hold both the angle of rotation as well as the axis of rotation
Last updated