1 / 36

Two-Dimensional Geometric Transformations

Two-Dimensional Geometric Transformations. Chapter 5. Two-Dimensional Geometric Transformations. Basic Transformations Translation Rotation Scaling Composite Transformations Other transformations Reflection Shear. Translation. Translation transformation

sylvie
Download Presentation

Two-Dimensional 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. Two-Dimensional Geometric Transformations Chapter 5

  2. Two-Dimensional Geometric Transformations • Basic Transformations • Translation • Rotation • Scaling • Composite Transformations • Other transformations • Reflection • Shear

  3. Translation • Translation transformation • Translation vector or shift vector T = (tx, ty) • Rigid-body transformation • Moves objects without deformation y y P’ T T p x x

  4. Rotation • Rotation transformation x’=rcos(+)= rcoscos-rsin sin y’=rsin(+)= rcossin+rsin cos y x=rcos y=rsin  P’ (x’,y’) x’=x cos-ysin y’=xsin+ycos P(x,y)   r x P’= R· P

  5. Rotation • Pivot point x’=xr+(x- xr)cos-(y- yr)sin y’=yr+(x- xr)sin+(y- yr)cos y P’ (x’,y’) P(x,y)   r (xr,yr) x

  6. Scaling • Scaling transformation • Scaling factors, sx and sy • Uniform scaling y y x x

  7. Scaling • Fixed point

  8. Matrix Representations and Homogeneous Coordinates • Homogeneous Coordinates • Matrix representations • Translation

  9. Matrix Representations • Matrix representations • Scaling • Rotation

  10. Composite Transformations • Translations

  11. Composite Transformations • Scaling

  12. Composite Transformations • Rotations

  13. General Pivot-Point Rotation • Rotations about any selected pivot point (xr,yr) • Translate-rotate-translate

  14. General Pivot-Point Rotation

  15. General Fixed-Point Scaling Scaling with respect to a selected fixed position (xf,yf)

  16. General Fixed-Point Scaling • Translate-scale-translate

  17. General Scaling Directions • Scaling factors sx and sy scale objects along the x and y directions. • We scale an object in other directions with scaling factors s1 and s2

  18. General Scaling Directions

  19. Concatenation Properties • Matrix multiplication is associative. A·B ·C = (A·B )·C = A·(B ·C) • Transformation products may not be commutative • Be careful about the order in which the composite matrix is evaluated. • Except for some special cases: • Two successive rotations • Two successive translations • Two successive scalings • rotation and uniform scaling

  20. Concatenation Properties • Reversing the order • A sequence of transformations is performed may affect the transformed position of an object.

  21. General Composite Transformations and Computer Efficiency • A general two-dimensional transformation • Rotation-scaling terms rsij • Translational terms trsx and trsy • Minimum number of computations • Four multiplications • Four additions

  22. Rigid-Body Transformation • Rigid-body transformation matrix • The upper-left 2-by-2 submatrix is an orthogonal matrix • Two vectors (rxx, rxy) and (ryx, ryy) form an orthogonal set of unit vectors. • Multiplicative rotation terms rij • Translational terms trx and try

  23. Rigid-Body Transformation • The orthogonal property of rotation matrices • We know the final orientation of an object Construct the desired transformation by assigning the elements of u’ to the first row of the rotation matrix and the elements of v’ to the second row.

  24. Computational Efficiency • Use approximations and iterative calculations to reduce computations • Approximate the trigonometric functions based on the first few terms of their power-series expansions. • For small enough angles (< 100), cos is approximately 1.sin is approximately  • Accumulated error control • Estimate the error in x’ and y’ at each step • Reset object positions when the error accumulation becomes too great

  25. Reflection • A transformation produces a mirror image of an object. • Axis of reflection • A line in the xy plane • A line perpendicular to the xy plane • The mirror image is obtained by rotating the object 1800 about the reflection axis. • Rotation path • Axis in xy plane: in a plane perpendicular to the xy plane. • Axis perpendicular to xy plane: in the xy plane.

  26. Reflection • Reflection about the x axis

  27. Reflection • Reflection about the y axis

  28. Reflection • Reflection relative to the coordinate origin

  29. Reflection • Reflection of an object relative to an axis perpendicular to the xy plane through Prfl

  30. Reflection • Reflection about the line y = x

  31. Shear • The x-direction shear relative to x axis If shx = 2:

  32. Shear • The x-direction shear relative to y = yref If shx = ½ yref = -1: 1 1/2 3/2

  33. Shear • The y-direction shear relative to x = xref 3/2 If shy = ½ xref = -1: 1/2 1

  34. Transformations between Coordinate Systems y y y’ x’ y’ θ y0 x’ θ x x x0

  35. Transformations between Coordinate Systems Method 1: Method 2:

  36. Affine Transformations • A coordinate transformation of the form x’=axxx+axyy+bx, y’=ayxx+ayyy+by • x’ and y’ is a linear function of the original coordinates x and y. • aij and bk are constants determined by the transformation type. • Translation, rotation, scaling, reflection, and shear are two-dimensional affine transformations. • An affine transformation involving only rotation, translation, and reflection preserves angles and lengths.

More Related