Basic Transformations:: Translation
Basic Transformations:: Translation
Basic Transformations:
tx ,
ty
ty
vector.
translation
Rotation:
A two dimensional rotation is applied to an object by repositioning it along a
circular path in xy plane. To generate rotation in circular path you needed two
things: rotation angle and position of the rotation point. Based on rotation point
(pivot point): Two types of rotations are possible.
Rotation based on origin
Rotation based on reference point
Rotation based on origin:
First you have to find out the transformation equation for rotation of a point P
when the pivot point is at origin of coordinates.
From the fig: Point is rotating from P(x, y) to P(x, y) based on origin.
Coordinates of the point P in the polar coordinates are:
From the fig: Coordinates of the point P(x, y) in the polar coordinates are:
Scaling:
Types of scaling:
Uniform Scaling
It produces the relative object proportions by common values
for Sx and Sy
Differential Scaling
It produces the irrelative object proportions by unequal values
for Sx and Sy
Matrix Representation and Homogeneous Coordinates:
Basic transformations can be expressed in the general matrix form:
P = M1 . P + M2
With coordinate positions P and P' represented as column vectors. Matrix M 1 is a 2
by 2 array containing multiplicative factors, and M2 is a two-element column matrix
containing translational terms. For translation M1 is the identity matrix. For rotation
or scaling: M2 contains the translational terms associated with the pivot point or
scaling fixed point. To produce a sequence of transformations with these equations,
such as scaling followed by rotation then translation, we must calculate the
transformed coordinates one step at a time. First, coordinate positions are scaled,
then these scaled coordinates are rotated, and finally the rotated coordinates are
translated. A more efficient approach would be to combine the transformations so
that the final coordinate positions are obtained directly from the initial coordinates,
thereby eliminating the calculation of intermediate coordinate values. To be able to
do this, we need to reformulate the above equation. To eliminate the matrix addition
associated with the translation terms in M2.
We can combine the multiplicative and translational terms for twodimensional geometric transformations in to a single matrix representation by
expanding the 2 by 2 matrix representations to 3 by 3 matrices. This allows us to
express all transformation equations as matrix multiplications, providing
that we also expand the matrix representations for coordinate positions. To express
any two-dimensional transformation as a matrix multiplication, we need three
variable coordinates. So we represent each Cartesian coordinate position (x, y) with
the homogeneous coordinate triple (
xh ,
yh
h), where
y=
yh
h
x=
x h /h
Composite Transformation:
Composite transformation is multiplying the individual transformation in
matrix form. We can set up a matrix: for any sequence of transformations as a
composite transformation matrix by calculating the matrix product of the individual
transformations. Forming products of transformation matrices is often referred to as
a concatenation or composition.
Now we will see how we are going to find the sequence transformation using
composite transformation.
For Translation:
If two successive translation vectors (tx1, ty1) and (tx2, ty2) are applied to the
coordinate position P, the final transformed position is P.
P = T(tx2, ty2) . {T(tx1, ty1) . P}
Or
T(tx2, ty2) . T(tx1, ty1) = T(tx1 + tx2, ty1 + ty2)
From the above matrix and equation: two successive translations are additive
For Rotation:
Similar to translation: Two successive rotations are applied to coordinate
position P and the final transformed position P is
Or
From the above equation: successive scaling operations are multiplicative.
Other Transformation:
Basic Transformations such as Translation, Rotation and Scaling are included
in all graphics packages. But some packages only providing few additional
transformations are:
Reflection and Shear.
Reflection:
Reflection is a transformation that produces a mirror image of an object.
Reflection is generated relative to an axis of reflection by rotating the object 180
about the reflection angle.
1. Reflection of an object about the x axis
This transform it keeps the x value and flips the y values of coordinate
position. Transformation matrix for Reflection about to the x axis is:
Shear:
This transformation is distorts the shape of an object. Two common shearing
transformations available:
Shift relative to the x axis direction
Shift in the x axis direction relative to the other reference line
Shift relative to the y axis direction
Shift in the y axis direction relative to the other reference line
Shear in the x axis direction:
This type of shear transformation is generated by only changing the x value of the
coordination of the image. From the above fig: you can understand. Transformation
matrix of shear relative to x axis and x axis direction is given below:
Or
Transformed coordinate position is:
x = x + y . Shx
y = y
y ref ):
Or
Transformed coordinate position is:
x = x + Shx (y -
y ref )
y = y
Or
Transformed coordinate position is:
x = x
y = y + x . Shy
y = y + Sh y (x -
x ref )
x ref ):