2d Shear Transformation
2d Shear Transformation
In Computer graphics,
2D Shearing is an ideal technique to change the shape of an existing
object in a two dimensional plane.
In a two dimensional plane, the object size can be changed along X direction as well as
Y direction.
So, there are two versions of shearing-
1. Shearing in X direction
2. Shearing in Y direction
Let-
Initial coordinates of the object O = (Xold, Yold)
Shearing parameter towards X direction = Shx
Shearing parameter towards Y direction = Shy
New coordinates of the object O after shearing = (Xnew, Ynew)
Shearing in X Axis-
Shearing in Y Axis-
Given a triangle with points (1, 1), (0, 0) and (1, 0). Apply shear parameter 2 on X axis
and 2 on Y axis and find out the new coordinates of the object.
Solution-
Given-
Old corner coordinates of the triangle = A (1, 1), B(0, 0), C(1, 0)
Shearing parameter towards X direction (Shx) = 2
Shearing parameter towards Y direction (Shy) = 2
Shearing in X Axis-
Shearing in Y Axis-