Page 84 - DCAP504_Computer Graphics
P. 84
Unit 6: 2-D Transformation
If all transformations are combined into one matrix, it will be easy to perform series of transformations
by using a single transformation matrix. This helps the graphic designer to write efficient code to
perform 2-D transformations. This can be achieved only if all the matrices are of same size. However, in
linear transformation, scaling and rotation matrices are of the size 2X2 and translation matrix is of the
size 2X1.
With the use of homogeneous coordinate system, it is easy to convert matrix of different sizes into
matrices of same size. The basic transformations in 2-D matrices can be converted into matrices of size 3
x 3 using homogeneous coordinate system. The transformation matrices of various transformations are
as follows:
1 0 d x
Translation matrix = 0 1 d y
0 0 1
S x 0 0
Scaling matrix = 0 y S 0
0 0 1
cos θ − sin θ 0
Rotation matrix = sin θ cos θ 0
0 0 1
1 a 0
X-Shear matrix= 0 1 0
0 0 1
1 0 0
Y-Shear matrix= b 1 0
0 0 1
The point coordinate matrix is represented as
x
P = y
1
The homogeneous coordinate matrices of point coordinate values are multiplied (matrix multiplication)
with the homogeneous transformation matrices to perform the respective transformation. The point
coordinate matrix after the transformation is represented as:
' x
P’ = 'y
1
LOVELY PROFESSIONAL UNIVERSITY 77