Transformations
Learn how to apply translation, rotation, and scaling to 3D data.
We'll cover the following...
Overview
A transformation is any function that we can apply to a set of geometric primitives, such as points or edges. Some examples of transformations include moving points by a scalar value, scaling them by a value, rotating, mirroring them across an axis, and more.
Translation, rotation, and scaling are three types of transformations with great importance in the world of 3D design. They belong to a special set of transformations called affine transformations. They’re essential in assembling 3D scenes, and nearly every major 3D design software has tools for these three transformations.
The affine transformations
Any transformation that preserves parallel lines is said to be an affine transformation. When we apply transformations to an object, those transformations are said to be affine if parallel lines on the object remain parallel after the transformation.
Affine transformations preserve two properties:
Collinearity: When we transform an object, all points along a line must remain along that line, regardless of whether that line is rotated, translated, stretched, etc.
Ratios of distances: All points must maintain the same relative distance from one another following the transform. For example, if a set of points in a line are all scaled by the same amount, then the relative distance between points should not change.
Technically speaking, projection is a type of transformation but it is not affine since it doesn’t preserve the properties of collinearity and ratios of distances. Some examples of affine transformations include the following:
Translation
Rotation
Scaling
Affine transformations are most often expressed as matrix multiplications between an affine transformation matrix such as
Translation, rotation, and scale form a subset of affine transformations called similarity transformation. We focus on similarity transformations because they preserve the shape of the objects as a whole.
Translation
Translation simply means to shift all points in an object by a scalar value along a single axis. The simplest way to execute a translation is to use addition. To move an object by
Vector form
The vector simply contains scalar terms corresponding to orthogonal shifts in each axis. For instance, the tuple to shift an object by
Matrix form
The transformation matrix form appears a bit more cumbersome but is valuable for cascading several transformations together. The camera extrinsic matrix can be represented in the following homogeneous form:
where