Chapter 5 Transformations
Chapter 5 Transformations
Design applications and facility layouts are created by arranging the orientations and sizes of the
component parts of the scene. And animations are produced by moving the "camera" or the
objects in a scene along animation paths. Changes in orientation, size, and shape are
accomplished with geometric transformations that alter the coordinate descriptions of objects.
The basic geometric transformations are translation, rotation, and scaling.
2D Transformations
Given a point cloud, polygon, or sampled parametric curve, we can use transformations for
several purposes:
1. Change coordinate frames (world, window, viewport, device, etc).
2. Compose objects of simple parts with local scale/position/orientation of one part defined
with regard to other parts. For example, for articulated objects.
3. Use deformation to create new shapes.
4. Useful for animation.
types of transformations:
1
Translation moves every point a constant distance in a specified direction. Like any rigid motion,
a translation may be decomposed into two reflections that are two indirect isometries. A
translation can also be interpreted as the addition of a constant vector to every point, or as
shifting the origin of the coordinate system.
Rotation is a transformation in a plane or in space that describes the motion of a rigid body
around a fixed point.
In two dimensions, only a single angle is needed to specify a rotation in two dimensions – the
angle of rotation. To carry out a rotation using matrices the point (x, y) to be rotated is written as
a vector, then multiplied by a matrix calculated from the angle, θ, like so:
2
where (x′, y′) are the co-ordinates of the point after rotation, and the formulae for x′ and y′ can be
seen to be
Non-uniform scaling is obtained when at least one of the scaling factors is different from the
others; a special case is directional scaling or stretching (in one direction). Non-uniform scaling
3
changes the shape of the object; e.g. a square may change into a rectangle, or into a
parallelogram if the sides of the square are not parallel to the scaling axes (the angles between
lines parallel to the axes are preserved, but not all angles).
Such a scaling changes the diameter of an object by a factor between the scale factors, the area
by a factor between the smallest and the largest product of two scale factors, and the volume by
the product of all three.
The scaling is uniform if and only if the scaling factors are equal . If all except one of
the scale factors are equal to 1, we have directional scaling.
In the case where , the scaling is also called an enlargement or dilation by a factor
A scaling in the most general sense is any affine transformation with a diagonalizable matrix. It
includes the case that the three directions of scaling are not perpendicular. It includes also the
case that one or more scale factors are equal to zero (projection), and the case of one or more
negative scale factors. The latter corresponds to a combination of scaling proper and a kind of
4
reflection: along lines in a particular direction we take the reflection in the point of intersection
with a plane that need not be perpendicular; therefore it is more general than ordinary reflection
in the plane.
5
scaling by 2 in all directions:
squeezing:
Formulas involving homogeneous coordinates are often simpler and more symmetric than their
Cartesian counterparts. If the homogeneous coordinates of a point are multiplied by a non-zero
scalar then the resulting coordinates represent the same point. An additional condition must be
added on the coordinates to ensure that only one set of coordinates corresponds to a given point,
so the number of coordinates required is, in general, one more than the dimension of the
6
projective space being considered. For example, two homogeneous coordinates are required to
specify a point on the projective line and three homogeneous coordinates are required to specify
a point on the projective plane
Any point in the projective plane is represented by a triple (X, Y, Z), called the
homogeneous coordinates of the point, where X, Y and Z are not all 0.
The point represented by a given set of homogeneous coordinates is unchanged if the
coordinates are multiplied by a common factor.
Conversely, two sets of homogeneous coordinates represent the same point if and only if
one is obtained from the other by multiplying by a common factor.
When Z is not 0 the point represented is the point (X/Z, Y/Z) in the Euclidean plane.
When Z is 0 the point represented is a point at infinity.
Note that the triple (0, 0, 0) is omitted and does not represent any point. The origin is
represented by (0, 0, 1).
3.4 Hierarchical Transformations
It is often convenient to model objects as hierarchically connected parts. For example, a robot
arm might be made up of an upper arm, forearm, palm, and fingers. Rotating at the shoulder on
the upper arm would affect all of the rest of the arm, but rotating the forearm at the elbow would
affect the palm and fingers, but not the upper arm. A reasonable hierarchy, then, would have the
upper arm at the root, with the forearm as its only child, which in turn connects only to the palm,
and the palm would be the parent to all of the fingers.
Each part in the hierarchy can be modeled in its own local coordinates, independent of the other
parts. For a robot, a simple square might be used to model each of the upper arm, forearm, and so
on. Rigid body transformations are then applied to each part relative to its parent to achieve the
proper alignment and pose of the object. For example, the fingers are positioned to be in the
appropriate places in the palm coordinates, the fingers and palm together are positioned in
forearm coordinates, and the process continues up the hierarchy. Then a transformation applied
to upper arm coordinates is also applied to all parts down the hierarchy.