Page 85 - DCAP504_Computer Graphics
P. 85
Computer Graphics
The matrix multiplication for 3X3 matrix is as show,
Let A and B are two 3X3 matrices,
a b c
A= d e f
g h i
k l m
B= n o p
q r s
k.a + n + q l . a + o + r . a m + p + s . c
.
b
.
b
c
.
b
c
.
.
.
e
f
e
.
A*B= k.d + n + q l . d + o + r . d m + p + s . f
f
.
e
.
.
.
h
i
.
h
.
i
.
.
h
i
k . g + . n + q l . g + o + r . g m + p + s
The resultant matrix after multiplication is a 3X3 matrix.
If matrix A is 3X3 and B is 3X1 then the multiplication is carried out as shown,
a b c
A= d e f
g h i
x
B= y
z
b
.
x.a + y + z . c
A*B= x.d + y + z
.
e
.
f
h
.
i
x . g + . y + z
The resultant matrix after multiplication is a 3X1 matrix.
The 2-D point coordinate (2, 4) is scaled by a scaling factor 2 in X and Y
directions of the 2-D space.
To apply the transformation we need to obtain the homogeneous representation
of the point coordinates.
The homogeneous representation of (2, 4) is [2 4 1]. This is represented in matrix
form as,
2
P = 4
1
2 0 0
Scaling factor = 0 2 0
0 0 1
Let P’ be the matrix value after scaling,
P’ = Scaling factor * P
2 0 0 2
= 0 2 0 4
0 0 1 1
78 LOVELY PROFESSIONAL UNIVERSITY