1 / 62

Geometric Transformations

UBI 516 Advanced Computer Graphics. Geometric Transformations. Aydın Öztürk ozturk @ ube.ege.edu.tr http:// ube.ege.edu.tr/~ozturk. Two Dimensional Geometric Transformations. Basic Transformations. Translation. P '. y. P. x. Basic Transformations. Rotation. y. P ′=(x′,y′). r. θ.

Download Presentation

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. UBI 516Advanced Computer Graphics Geometric Transformations Aydın Öztürk ozturk@ube.ege.edu.tr http://ube.ege.edu.tr/~ozturk

  2. Two Dimensional Geometric Transformations

  3. Basic Transformations Translation P' y P x

  4. Basic Transformations Rotation y P′=(x′,y′) r θ φ x

  5. Basic Transformations Rotation (Cont.)

  6. Basic Transformations Scaling y x

  7. 3x3 Matrix Representations • We can combine the multiplicative and translational terms for 2D transformations into a single matrix representation by expanding the 2x2 matrix representations to 3x3 matrices. • This allows us to express all transformation equations as matrix multiplications.

  8. Homogeneous Coordinates • We represent each Cartesian coordinate position (x,y) with the homogeneous coordinate triple where

  9. Homogeneous Coordinates(cont.) • Thus, a general homogeneous coordinate representation can also be written as For 2D transformations we chooseh=1. Each 2D position is represented with homogeneous coordinates

  10. Translation in homogeneous coordinates

  11. Rotation in homogeneous coordinates

  12. Scaling in homogeneous coordinates

  13. Composite Transformations:Translation If two successive translation are applied to a point P, then the final transformed location P'is calculated as

  14. Composite Transformations:Rotation

  15. Composite Transformations:Scalings

  16. General Pivot Point Rotation • Steps: -Translate the object so that the pivot point is moved to the coordinate origin. -Rotate the object about the origin. -Translate the object so that the pivot point is returned to its original position.

  17. General Pivot Point Rotation(Cont.)

  18. General Pivot Point Rotation(Cont.)

  19. General Fixed Point Scaling • Steps: -Translate the object so that the fixed point coincides with the coordinate origin. -Scale the object about the origin. -Translate the object so that the pivot point is returned to its original position.

  20. General Fixed Point Scaling (xr, yr) (xr, yr)

  21. General Fixed Point Scaling

  22. Concatenation Properties • Matrix multiplication is associative • Transformation product is not commutative

  23. Reflection About x-axis About y-axis OTHER TRANSFORMATIONS 1 y 2 3 x 2 3 1

  24. OTHER TRANSFORMATIONS 1 Reflection about the origin y 3 2 2 x 1 3

  25. OTHER TRANSFORMATIONS 3 y = x Reflection about the line y=x. y 2 1 3 2 2 x

  26. OTHER TRANSFORMATIONS Shear x-direction shear y y x x

  27. TRANSFORMATION BETWEEN COORDINATE SYSTEMS • Individual objects may be defined in their local cartesian reference system. • The local coordinates must be transformed to position the objects within the scene coordinate system.

  28. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) • Steps for coordinate transformation -Translate so that the origin (x0, y0 ) of the x′-y′ system is moved to the origin of the x-y system. -Rotate the x′ axis on to the axis x.

  29. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y x′ y′ θ y0 0 x0 x

  30. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y y0 x′ y′ θ 0 x0 x

  31. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y y0 y′ x′ 0 x0 x

  32. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.)

  33. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) An alternative method: -Specify a vector V that indicates the direction for the positive y′ axis. Let -Obtain the unit vector u=(ux ,u y) along the x′ axis by rotating v 900 clockwise.

  34. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) -Elements of any rotation matrix can be expressed as elements of orhogonal unit vectors. That is, the rotation matrix can be written as

  35. TRANSFORMATION BETWEEN COORDINATE SYSTEMS(Cont.) y x′ y′ y0 V 0 x0 x

  36. Three Dimensional Geometric Transformations

  37. 3D Translation y P′=(x′,y′,z′) P=(x,y,z) x z

  38. 3D Translation

  39. 3D Rotation(z-axis) y z-axis rotation P=(x,y,z) x z

  40. 3D Rotation(z-axis)

  41. 3D Rotation(x-axis) y x-axis rotation P=(x,y,z) x z

  42. 3D Rotation(x-axis)

  43. 3D Rotation(y-axis) y y-axis rotation P=(x,y,z) x z

  44. 3D Rotation(y-axis)

  45. General 3D Rotation Rotation about an axis that is parallel to x-axes. -Translate object so that the rotation axis coincides with the parallel coordinate axis. -Perform specified rotation about the axis. -Translate the object so that the rotation axis is moved back to its original position.

  46. Rotation about an axis that is parallel to x-axes. y Rotation axis x z

  47. General 3D Rotation Rotation about an axis that is not parallel to one of the coordinate axes. -Translate object so that the rotation axis passes through the coordinate origin. -Rotate object so that the axis of rotation coincides with one of the coordinate axes. -Perform the specified rotation about that coordinate axis -Apply inverse rotations to bring the rotation axis back to its original orientation. -Apply the inverse translation to brig the rotation axis back to its original position.

  48. Rotation about an axis that is not parallel to one of the coordinate axes. y Initial Position P2 Rotation axis P1 x z

  49. Rotation about an axis that is not parallel to one of the coordinate axes. y Translate P1 to the origin P2 P1 x z

  50. Rotation about an axis that is not parallel to one of the coordinate axes. y P2 x P1 z Rotate P2 onto the z-axis and rotate the object around it.

More Related