Vous êtes sur la page 1sur 4

Chapter 5: 2-D Shearing

Geometric  Distorts the shape such that the


transformed shape appears as if the object
Transformations were composed of layers that had been
caused to slide over each other.
 Shearing is done in x-direction (shx) and in
Shearing, Composite y-direction (shy).
Transformations, Properties of  +ive values of shx causes a shift in the object
towards right.
transformations  -ive values of shx causes a shift in the object
towards left.
 +ive values of shy causes an upward shift in the
object.
 -ive values of shy causes a downward shift in the
object.

Shearing in x Shearing w.r.t a reference line


 Shearing w.r.t. a reference lines shears and
translates an object too by a shift amount.
 Shift = -shx.yref  for x-direction shearing.
 Shift = -shy.xref  for y-direction shearing.

 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

Reference line here is xref = -1


WHAT IS A REFERENCE LINE?

2D Composite Transformations Composite 2D Translations


 Sequence of transformations: composite transformation matrix
 Matrices listed in reverse order P ' = T (t 2 x , t 2 y ) ⋅ {T (t1 x , t1 y ) ⋅ P} = {T (t 2 x , t 2 y ) ⋅ T (t1x , t1 y )}⋅ P

 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

 0 0 1  0 0 1  0 0 1 s2 y s1 y s1 x ⋅ s2 y


     
 0 0 1  0 0 1  0 0 1
R (θ 2 ) ⋅ R (θ1 ) = R (θ 2 + θ1 )
S ( s2 x , s2 y ) ⋅ S ( s1x , s1 y ) = S ( s1x s2 x , s1 y s2 y )

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!

Vous aimerez peut-être aussi