Presentation is loading. Please wait.

Presentation is loading. Please wait.

2D TRANSFORMATIONS.

Similar presentations


Presentation on theme: "2D TRANSFORMATIONS."— Presentation transcript:

1 2D TRANSFORMATIONS

2 To be discussed… Need of 2D-transformation. Types of transformation
- Translation - Rotation - Scaling Composite transformation Reflection Shearing

3 2D Transformations Need of transformation:
-The geometrical changes of an object from a current state to modified state. Need of transformation: -To manipulate the initially created object and to display the modified object without having to redraw it.

4 2D Transformations 2 ways Object Transformation
Alter the coordinates descriptions of an object. Translation, rotation, scaling etc. Coordinate system remains unchanged. Coordinate transformation Produce a different coordinate system.

5 Translation A translation moves all points in an object along the same straight-line path to new positions. The path is represented by a vector, called the translation or shift vector. We can write the components: p'x px p'y = py or in matrix form: P' = P + T (2, 2) = 6 =4 ? ty tx tx ty

6 Matrix Representation
Point in column-vector: Our point now has three coordinates. So our matrix is needs to be 3x3. Translation: x y 1 BACK

7 Rotation P’ A rotation repositions all points in an object along a circular path in the plane centered at the pivot point. First, we’ll assume the pivot is at the origin. P

8 Rotation r  P(x,y) y x P’(x’, y’)  y’  x’
We can write the components: p'x = px cos  – py sin  p'y = px sin  + py cos  or in matrix form: P' = R • P  can be clockwise (-ve) or counterclockwise (+ve as our example). y’ P(x,y) r y x x’ BACK

9 Scaling P’ Scaling changes the size of an object and involves two scale factors, Sx and Sy for the x- and y- coordinates respectively. Scales are about the origin. We can write the components: p'x = sx • px p'y = sy • py or in matrix form: P' = S • P Scale matrix as: P

10 Matrix Representation
Rotation Scaling BACK

11 Composite Transformation
We can represent any sequence of transformations as a single matrix. Composite transformations: Rotate about an arbitrary point – translate, rotate, translate Scale about an arbitrary point – translate, scale, translate Change coordinate systems – translate, rotate, scale

12 Composite Transformation Matrix
Arrange the transformation matrices in order from right to left. General Pivot- Point Rotation Operation :- Translate (pivot point is moved to origin) Rotate about origin Translate (pivot point is returned to original position) T(pivot) • R() • T(–pivot) tx ty cos -sin 0 sin cos 0 tx ty . cos -sin -tx cos+ ty sin sin cos -tx sin - ty cos tx ty . cos -sin -tx cos+ ty sin + tx sin cos -tx sin - ty cos + ty

13 Composite Transformation Matrix
General Fixed-Point Scaling Operation :- Translate (fixed point is moved to origin) Scale with respect to origin Translate (fixed point is returned to original position) BACK

14 Other transformations
Reflection: x-axis y-axis

15 Other transformations
Reflection: origin line x=y BACK

16 Other transformations
Shear: x-direction y-direction BACK

17 Thankyou BACK


Download ppt "2D TRANSFORMATIONS."

Similar presentations


Ads by Google