Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

BASIC TRANSFORMATIONS

introduction
Alter the coordinate descriptions of objects - changes in
orientation, size, and shape .
The basic geometric transformations are
Translation
Rotation
Scaling
Translation
Rotation
Scaling
Translation
Applied to an object by repositioning it along a straight-line
path from one coordinate location to another.
We translate a two-dimensional point by adding translation
distances, t
x
, and t
y
, to the original coordinate position (x, y) to
move the point to a new position ( x ' , y').
x' = x + t
x.
y' = y + t
y
.
The translation distance pair (t
x
, t
y
) is called a translation
vector or shift vector.
Representation of single matrix equation by using column
vectors to represent coordinate positions and the translation
vector is given as
P= P = T=

P=P+T
Translation is a rigid-body transformation that moves objects
without deformation.
A straight line segment is translated by applying the
transformation equation to each of the line endpoints and
redrawing the line between the new endpoint positions.
Polygons are translated by adding the translation vector to the
coordinate position of each vertex and regenerating the polygon
using the new set of vertex coordinates and the current attribute
settings.
Circle or ellipse is translated by the center coordinates and redraw
the figure in the new location
We translate other curves (for example, splines) by displacing the
coordinate positions defining the objects, and then we reconstruct
the curve paths using the translated coordinate points.
Translation
Rotation
A two-dimensional rotation is applied to an object by
repositioning it along a circular path in the xy plane.
To generate a rotation, we specify a rotation angle and the
position (x, y), of the rotation point (or pivot point) about
which the object is to be rotated.
Positive values for the rotation angle define counter clockwise
rotations about the pivot point, and negative values rotate
objects in the clockwise direction.
This transformation can also be described as a rotation about a
rotation axis that is perpendicular to the xy plane and passes
through the pivot point.
r is the constant distance of the point from the origin, angle
is the original angular position of the point from the horizontal,
and is the rotation angle.
Using standard trigonometric identities, we can express the
transformed coordinates in terms of angles and as
x=r cos( + )= r cos cos r sin sin
y=r sin( + )= r cos sin + r sin sin
The original coordinates of the point in polar coordinates are
x = r cos y = r sin
Substituting expressions, we obtain the transformation
equations for rotating a point at position (x, y) through an
angle about the origin:
x = x cos y sin
y = x sin + y cos
We can write the rotation equations in the matrix form: P =RP.
Transformed row coordinate vector [x' y'] is calculated as
PT = (RP)
T
= P
T
R
T


Rotation
A straight line segment is rotated by applying the rotation
equations to each of that line endpoints and redrawing the line
between the new endpoint positions.
Polygons are rotated by displacing each vertex through the
specified rotation angle and regenerating the polygon using the
new vertices.
Curved lines are rotated by repositioning the defining points
and redrawing the curves.
A circle or an ellipse, for instance, can be rotated about a non
central axis by moving the center position through the arc that
subtends the specified rotation angle.
An ellipse can be rotated about its center coordinates by
rotating the major and minor axes.
Rotation
Scaling
A scaling transformation alters the size of an object.
This operation can be carried out for polygons by multiplying
the coordinate values (x, y) of each vertex by scaling factors
s
x
, and s
y
, to produce the transformed coordinates
(x', y'): x = x s
x
y= y s
y;

Matrix form: P=SP
When s
x
, and s
y
, are assigned the same value, a uniform
scaling is produced that maintains relative object proportions.
Unequal values for s
x
, and s
y
, result in a differential scaling
that is often used in design applications, where pictures are
constructed from a few basic shapes that can be adjusted by
scaling and positioning transformations.
We can control the location of a scaled object by choosing a
position, called the fixed point that is to remain unchanged
after the scaling transformation. Coordinates for the fixed
point (x
l
, y
l
) can be chosen as one of the vertices, the object
centroid, or any other position.
Polygons are scaled by applying transformations to each
vertex and then regenerating the polygon using the
transformed vertices.
Other objects are scaled by applying the scaling transformation
equations to the parameters defining the objects. An ellipse in
standard position is resized by scaling the semi-major and
semi-minor axes and redrawing the ellipse about the
designated center coordinates.
Uniform scaling of a circle is done by simply adjusting the
radius.
Scaling
MATRIX REPRESENTATIONS AND
HOMOGENEOUS COORDINATES
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 of matrices.
For column-matrix representation of coordinate positions, we
form composite transformations by multiplying matrices in
order from right to left. That is, each successive transformation
matrix pre-multiplies the product of the preceding
transformation matrices.
Translations
If two successive translation vectors (t
x1
, t
y1
) and (t
x2
, t
y2
) are
applied to a coordinate position P, the final transformed
location P' is calculated as P= {T(t
x2
, t
y2
) T(t
x1
, t
y1
)}P, where P
and P are represented as homogeneous-coordinate column
vectors.

Rotations
Two successive rotations applied to point P produce the
transformed position
P=R(
2
) . {R(
1
) . P}
P={R(
2
) . R(
1
)} . P
R(
2
) . R(
1
) = R(
1
+
2
)

P=R(
1
+
2
)P

Scaling
Concatenating transformation matrices for two successive
scaling operations produces the following composite scaling
matrix




S(s
x2
,s
y2
) S(s
x1
,s
y1
) = S(s
x1
s
x2
,s
y1
s
y2
).

General Pivot-Point Rotation
With a graphics package that only provides a rotate function
for revolving objects about the coordinate origin, we can
generate rotations about any selected pivot point (x, y,) by
performing the following sequence of translate-rotate translate
operations:
Translate the object so that the pivot-point position is
moved to the coordinate origin.
Rotate the object about the coordinate origin.
Translate the object so that the pivot point is returned to its
original position
Original Position Translation of an object
to origin
Rotation of an object
about origin
Translation of an object to original position
General Fixed-Point scaling
A transformation sequence to produce scaling with respect to a
selected fixed position (x, y,) using a scaling function that can
only scale relative to the coordinate origin.
1. Translate object so that the fixed point coincides with the
coordinate origin.
2. Scale the object with respect to the coordinate origin.
3. Use the inverse translation of step 1 to return the object to
its original position.

Original Position
Translation of an object
to origin
Scale the object
about origin
Translation of the object
to original position
Brain activity
1. There are six eggs in the basket. Six people each take one of
the eggs. How can it be that one egg is left in the basket?
2. A murderer is condemned to death. He has to choose between
three rooms. The first is full of raging fires, the second of
assassins with loaded guns, and the third of lions that haven't
eaten in 3 years. Which room is the safest for him to go to?
3. If there's a frog, dead in the centre of a lilypad which is right in
the middle of the pond, which side would it jump to?
1. The last person took the basket with the last egg still inside.
2. The third. Lions that haven't eaten in three years would
certainly have been dead.
3. neither, the frog is dead!
MIND MAP

You might also like