1 / 17

2D TRANSFORMATIONS

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

duena
Download Presentation

2D TRANSFORMATIONS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 -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. ? =4 ty = 6 tx (2, 2) 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 ’ ’ 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 • 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’  P

  8. Rotation P’(x’, y’) • We can write the components: • p'x= pxcos – pysin  • p'y= pxsin  + pycos • 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. P’ P Scaling • 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:

  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. cos -sin 0 sin cos 0 0 0 1 1 0 -tx 0 1 -ty 0 0 1 . . 1 0 tx 0 1 ty 0 0 1 cos -sin -tx cos+ ty sin sin cos -tx sin - ty cos 0 0 1 1 0 tx 0 1 ty 0 0 1 . cos -sin -tx cos+ ty sin + tx sin cos -tx sin - ty cos + ty 0 0 1 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)

  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

More Related