Lecture 12
Lecture 12
x ' 1 shx 0 x
y ' = sh 1 0 ⋅ y MATRIX FOR SHEARING IN Y - ?
0y
1 0 0 1 1
1
Result of shearing an object in Result of shearing an object in x-
y-direction direction w.r.t a reference line
1 0 t 2 x 1 0 t1 x 1 0 t1x + t 2 x
x' x x 0 1 t ⋅ 0 1 t = 0 1 t + t
y ' = M ⋅ M ⋅ y = (M ⋅ M ) ⋅ y 2y 1y 2y
2 1
1y
2 1
0 0 1 0 0 1 0 0 1
1 1 1
T (t 2 x , t 2 y ) ⋅ T (t1x , t1 y ) = T (t1x + t 2 x , t1 y + t 2 y )
P' = M 2 ⋅ M 1 ⋅ P = M ⋅ P
2
Composite 2D Rotations Composite 2D Scalings
P ' = R (θ 2 ) ⋅ {R (θ1 ) ⋅ P} = {R (θ 2 ) ⋅ R (θ1 )}⋅ P
P ' = S ( s2 x , s2 y ) ⋅ {S ( s1x , s1 y ) ⋅ P} = {S ( s2 x , s2 y ) ⋅ S ( s1x , s1 y )}⋅ P
cos θ 2 − sin θ 2 0 cos θ1 − sin θ1 0 cos(θ1 + θ 2 ) − sin (θ1 + θ 2 ) 0
sin θ cos θ 2 0 ⋅ sin θ1 cos θ1 0 = sin (θ1 + θ 2 ) cos(θ1 + θ 2 ) 0 s2 x 0 0 s1x 0 0 s1x ⋅ s 2 x 0 0
0 0 ⋅ 0 0 = 0 0
2
General 2D Fixed-Point
General 2D Pivot-Point Rotation
Scaling
R (xr , y r , θ ) = T (xr , y r ) ⋅ R (θ ) ⋅ T (− xr ,− y r ) S (x f , y f , s x , s y ) = T (x f , y f )⋅ S (s x , s y )⋅ T (− x f ,− y f )
3
Matrix Concatenation Properties
Associative: M 3 ⋅ M 2 ⋅ M 1 = (M 3 ⋅ M 2 ) ⋅ M 1 = M 3 ⋅ (M 2 ⋅ M 1 )
Not commutative: M 2 ⋅ M1 ≠ M1 ⋅ M 2
Order is important!