2D Geometric Transformations Chapter 4 2D Geometric Transformations
Agenda 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
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
Basic 2D Transformations Translation Scale Rotation Shear
Transformation Matrix Notation Inverse Transformation Matrix Matrix Notations Transformation Name Transformation Matrix Notation Inverse Transformation Matrix Translation T(a, b) T-1(a,b) = T(-a, -b) Rotation R(θ) R-1(θ) = R(-θ) Scaling S(sx, sy) S-1 (sx, sy) =( 1 𝑆𝑥 , 1 𝑆𝑦 ) Reflection About x-axis Mx(a, b) Mx-1 (a, b) = Mx(a, -b) Reflection About y-axis My(a, b) My-1 (a, b) = My(-a, b) Reflection About the origin Mo(a, b) Mo-1 (a, b) = Mo(-a, -b)
Matrix Representation Represent a 2D Transformation by a Matrix Apply the Transformation to a Point Transformation Matrix Point
Matrix Representation Transformations can be combined by matrix multiplication Transformation Matrix Matrices are a convenient and efficient way to represent a sequence of transformations
2×2 Matrix (2D Scaling) 2D Identity 2D Scaling
2×2 Matrix (2D Rotation & Shearing) 2D Shearing
2×2 Matrix (2D Reflection) 2D Mirror over Y axis 2D Mirror over (0,0)
2×2 Matrix (2D Translation) This transformation cannot be represented with a 2×2 matrix? 2D Translation NO!! Only linear 2D transformations can be Represented with 2x2 matrix
Homogeneous coordinates Reason? Unification and extension of concepts Best way to represent a sequence of transformations 2D translation can be represented by a 3×3 matrix Point represented with homogeneous coordinates
Basic 2D Translation A translation moves all points of an object a fixed distance in a specified direction.
Basic 2D Rotation It rotates points in the xy-Cartesian plane counterclockwise through an angle θ about the origin of the Cartesian coordinate system.
Basic 2D Scaling It is a linear transformation that enlarges (increases) or shrinks (diminishes) objects by a scale factor that is the same in all directions.
Basic 2D Shearing A transformation that distorts the shape of an object. Two types of shearing transformations are there about X values and about Y values
Basic 2D Transformations Basic 2D transformations as 3x3 Matrices Translate Scale Rotate Shear
Matrix Composition Transformations can be combined by matrix multiplication Matrix multiplication is associative
Matrix Composition Rotate by around arbitrary point (a,b) Scale by sx, sy around arbitrary point (a,b) (a,b) (a,b)
Pivot-Point Rotation (xr,yr) Translate Rotate Translate
General Fixed-Point Scaling (xf,yf) Translate Scale Translate
Translate-Rotate-Translate Final position Original position
Reflection Reflection about x-axis (y=0) Reflection about y-axis (x=0) Refection about the origin (0, 0) Reflection about the line y = x Reflection about the line y = ax + b
Reflection about x-axis (y=0) 1 x 3 2 1’ 3’ 2’
Reflection about y-axis (x=0) 1 3 2 1’ 3’
Refection about the origin (0, 0) x y 3 1’ 3’ 2 1
Reflection about the line y = x Reflection with respect to a Line Clockwise rotation of 45 Reflection about the x axis Counterclockwise rotation of 45 x y x y x y 1 3 2 1’ 3’ 2’ x y
Reflection about the line y = -x
Reflection about the line y = ax+b Translation Rotation Reflection Reverse Rotation Reverse Translation x y