1 / 32

2D Geometric Transformations

2D Geometric Transformations. Contents. Definition & Motivation 2D Geometric Transformation Translation Rotation Scaling Matrix Representation Homogeneous Coordinates Matrix Composition Composite Transformations Pivot-Point Rotation General Fixed-Point Scaling

glenda
Download Presentation

2D Geometric 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 Geometric Transformations cgvr.korea.ac.kr

  2. Contents • Definition & Motivation • 2D Geometric Transformation • Translation • Rotation • Scaling • Matrix Representation • Homogeneous Coordinates • Matrix Composition • Composite Transformations • Pivot-Point Rotation • General Fixed-Point Scaling • Reflection and Shearing • Transformations Between Coordinate Systems cgvr.korea.ac.kr

  3. Geometric Transformation • Definition • Translation, Rotation, Scaling • Motivation – Why do we need geometric transformations in CG? • As a viewing aid • As a modeling tool • As an image manipulation tool cgvr.korea.ac.kr

  4. Example: 2D Geometric Transformation Modeling Coordinates World Coordinates cgvr.korea.ac.kr

  5. Example: 2D Scaling Modeling Coordinates Scale(0.3, 0.3) World Coordinates cgvr.korea.ac.kr

  6. Example: 2D Rotation Modeling Coordinates Scale(0.3, 0.3) Rotate(-90) World Coordinates cgvr.korea.ac.kr

  7. Example: 2D Translation Modeling Coordinates Scale(0.3, 0.3) Rotate(-90) Translate(5, 3) World Coordinates cgvr.korea.ac.kr

  8. Example: 2D Geometric Transformation Modeling Coordinates Again? World Coordinates cgvr.korea.ac.kr

  9. Example: 2D Geometric Transformation Modeling Coordinates Scale Translate Scale Rotate Translate World Coordinates cgvr.korea.ac.kr

  10. Basic 2D Transformations • Translation • Scale • Rotation • Shear cgvr.korea.ac.kr

  11. Basic 2D Transformations • Translation • Scale • Rotation • Shear Transformations can be combined (with simple algebra) cgvr.korea.ac.kr

  12. Basic 2D Transformations • Translation • Scale • Rotation • Shear cgvr.korea.ac.kr

  13. Basic 2D Transformations • Translation • Scale • Rotation • Shear cgvr.korea.ac.kr

  14. Basic 2D Transformations • Translation • Scale • Rotation • Shear cgvr.korea.ac.kr

  15. Basic 2D Transformations • Translation • Scale • Rotation • Shear cgvr.korea.ac.kr

  16. Matrix Representation • Represent a 2D Transformation by a Matrix • Apply the Transformation to a Point Transformation Matrix Point cgvr.korea.ac.kr

  17. Matrix Representation • Transformations can be combined by matrix multiplication Transformation Matrix Matrices are a convenient and efficient way to represent a sequence of transformations cgvr.korea.ac.kr

  18. 2×2 Matrices • What types of transformations can be represented with a 2×2 matrix? 2D Identity 2D Scaling cgvr.korea.ac.kr

  19. 2×2 Matrices • What types of transformations can be represented with a 2×2 matrix? 2D Rotation 2D Shearing cgvr.korea.ac.kr

  20. 2×2 Matrices • What types of transformations can be represented with a 2×2 matrix? 2D Mirror over Y axis 2D Mirror over (0,0) cgvr.korea.ac.kr

  21. 2×2 Matrices • What types of transformations can be represented with a 2×2 matrix? 2D Translation NO!! Only linear 2D transformations can be Represented with 2x2 matrix cgvr.korea.ac.kr

  22. 2D Translation • 2D translation can be represented by a 3×3 matrix • Point represented with homogeneous coordinates cgvr.korea.ac.kr

  23. Basic 2D Transformations • Basic 2D transformations as 3x3 Matrices Translate Scale Rotate Shear cgvr.korea.ac.kr

  24. Homogeneous Coordinates • Add a 3rd coordinate to every 2D point • (x, y, w) represents a point at location (x/w, y/w) • (x, y, 0) represents a point at infinity • (0, 0, 0) Is not allowed y 2 (2, 1, 1) or (4, 2, 2) or (6, 3, 3) 1 x 1 2 Convenient Coordinate System to Represent Many Useful Transformations cgvr.korea.ac.kr

  25. Matrix Composition • Transformations can be combined by matrix multiplication • Efficiency with premultiplication • Matrix multiplication is associative cgvr.korea.ac.kr

  26. Matrix Composition • Rotate by  around arbitrary point (a,b) • Scale by sx, sy around arbitrary point (a,b) (a,b) (a,b) cgvr.korea.ac.kr

  27. (xr,yr) (xr,yr) (xr,yr) (xr,yr) Pivot-Point Rotation Translate Rotate Translate cgvr.korea.ac.kr

  28. (xf,yf) (xf,yf) (xf,yf) (xf,yf) General Fixed-Point Scaling Translate Scale Translate cgvr.korea.ac.kr

  29. Reflection • Reflection with respect to the axis • x• y• xy y 1 y y 1 1’ 1’ 2 3 2 3 3’ 2 3’ 2 x x x 3 2’ 3’ 1 2 1’ cgvr.korea.ac.kr

  30. y y y y 1 2 3 x x x x 2’ 3’ 1’ Reflection • Reflection with respect to a Line • Clockwise rotation of 45  Reflection about the x axis  Counterclockwise rotation of 45 y=x cgvr.korea.ac.kr

  31. y y y y x x x x Shear • Converted to a parallelogram x’ = x + shx · y, y’ = y • Transformed to a shifted parallelogram (Y = Yref) x’ = x + shx ·(y-yref), y’ = y (1,1) (0,1) (2,1) (3,1) (0,0) (1,0) (0,0) (1,0) (Shx=2) (2,1) (1,1) (1,1) (0,1) (1/2,0) (3/2,0) (0,0) (1,0) (0,-1) (Shx=1/2, yref=-1) cgvr.korea.ac.kr

  32. y x Shear • Transformed to a shifted parallelogram (X = Xref) x’ = x, y’ = shy ·(x-xref) + y (1,2) (0,3/2) y (1,1) (0,1) (0,1/2) (1,1) x (0,0) (1,0) (-1,0) (Shy=1/2, xref=-1) cgvr.korea.ac.kr

More Related