Page 81 - DCAP504_Computer Graphics
P. 81
Computer Graphics
Consider a point coordinate (x, y), represented in the matrix form as,
x
P=
y
Let, P’ be the coordinate after shear transformation,
P’=Sh.P
Here, Sh can be either X or Y-shear.
If it is X-shear then,
1 a x
P’=
0 1 y
+ ayx
P’=
y
If it is Y-shear then
1 0 x
P’=
b 1 y
x
P’=
bx + y
Consider a rectangle object with point coordinates (0, 0), (2, 0), (2, 2) and (0, 2).
The rectangle undergoes X-shear with the shear factor value 1.
The shear transform matrix for X-shear is given as,
1 a 1 1
=
Sh x =
0 1 0 1
Here, the value of the shear factor, a=1.
After multiplying the point coordinates of the rectangle with the X-shear
transform matrix individually we obtain the following coordinate points that
define the rectangle after X-shear transform are (0, 0), (2, 0), (4, 2) and (2, 2).
If the value of a=-1, then the X-shear transform matrix is given as,
1 −1
Sh x
=
0 1
Then the value of the rectangle after X-shear transform are (0, 0), (2, 0), (0, 2)
and (-2, 2).
74 LOVELY PROFESSIONAL UNIVERSITY