Download presentation
1
2D Geometric Transformations
Chapter 4 2D Geometric Transformations
2
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
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
4
Basic 2D Transformations
Translation Scale Rotation Shear
5
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)
6
Matrix Representation
Represent a 2D Transformation by a Matrix Apply the Transformation to a Point Transformation Matrix Point
7
Matrix Representation
Transformations can be combined by matrix multiplication Transformation Matrix Matrices are a convenient and efficient way to represent a sequence of transformations
8
2×2 Matrix (2D Scaling) 2D Identity 2D Scaling
9
2×2 Matrix (2D Rotation & Shearing)
2D Shearing
10
2×2 Matrix (2D Reflection)
2D Mirror over Y axis 2D Mirror over (0,0)
11
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
12
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
13
Basic 2D Translation A translation moves all points of an object a fixed distance in a specified direction.
14
Basic 2D Rotation It rotates points in the xy-Cartesian plane counterclockwise through an angle θ about the origin of the Cartesian coordinate system.
15
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.
16
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
17
Basic 2D Transformations
Basic 2D transformations as 3x3 Matrices Translate Scale Rotate Shear
18
Matrix Composition Transformations can be combined by matrix multiplication Matrix multiplication is associative
19
Matrix Composition Rotate by around arbitrary point (a,b)
Scale by sx, sy around arbitrary point (a,b) (a,b) (a,b)
20
Pivot-Point Rotation (xr,yr) Translate Rotate Translate
21
General Fixed-Point Scaling
(xf,yf) Translate Scale Translate
22
Translate-Rotate-Translate
Final position Original position
23
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
24
Reflection about x-axis (y=0)
1 x 3 2 1’ 3’ 2’
25
Reflection about y-axis (x=0)
1 3 2 1’ 3’
26
Refection about the origin (0, 0)
x y 3 1’ 3’ 2 1
27
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
28
Reflection about the line y = -x
29
Reflection about the line y = ax+b
Translation Rotation Reflection Reverse Rotation Reverse Translation x y
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.