Title: 2D GEOMETRIC TRANSFORMATION
1- 2D GEOMETRIC TRANSFORMATION
2- 2D Transforms
- Translation
- Rotation
- Scaling
- Composition
- Homogeneous Coordinates
32D Transforms
- In many applications it is necessary to modify
the position, orientation or size of a 2D object. - The most widely used transformations are
- Translation move one object to another position
- Rotation rotate the object around the origin
- Scaling change the size of the object
42D Transforms
- We are going to see how to transform one point.
- In order to transform an object, we transform the
points that define it. For instance - Polygon its vertices
- Circle its center and, perhaps, its radius
52D Transforms Translation
- Add a distance in x and y to the point.
V
T
V
6 7Scaling
- Changing the size of an object
- In the figure, sx sy 0.5.
- The size of the line is reduced and moved closer
to the origin.
8 9Rotation
- A point is rotated around the origin.
- Rotation is through an angle q.
x, y
q
x, y
10 11Translation in Homogeneous Coordinates (HC)
12Scaling in HC
13Rotation in HC
14Composition of transformationsImages taken from
Hearn Baker. Computer Graphics with OpenGL.
3rd Ed.
- Example Rotate an object around an arbitrary
point. - Translate P so that the axis is at the origin
- Rotate the object
- Translate the object so that P returns to its
position
15Composition of Transformations
- The final transform becomes a multiplication of
several matrices.
16Composition of transformationsImages taken from
Hearn Baker. Computer Graphics with OpenGL.
3rd Ed.
- Example Scale an object in its place
17Composition of transformations
- Multiplication of matrices
18Inverse transformations
- The inverse of the transformation is the inverse
of its matrix - Translation
19Inverse transformations
20Inverse transformations
21Transformation composition properties
- Multiplication of matrices is associative
22Transformation Composition properties
- Multiplication of matrices is not commutative
23Transformation composition propertiesImages
taken from Hearn Baker. Computer Graphics with
OpenGL. 3rd Ed.
24Other two-dimensional transformations
- Reflection around the x axis (y 0).
25Other two-dimensional transformations
- Reflection around the y axis (x 0).
26Other two-dimensional transformations
- Reflection relative to the coordinate origin.
27Shear
- A transformation that distorts the shape of an
object such that the transformed shape appears as
if the object were composed of internal layers
that had been caused to slide over each other is
called a shear.
28Shear
- The transformed positions are