Applications Of Matrices In Computer Graphics
Abstract-Column matrices can be used to represent points in 2D or 3D, while matrices of dimension 2×n and 3×n can be used to represent sets of points in 2D or 3D. Matrices allow arbitrary linear transformations to be represented in a consistent format (T(x)=Ax for some 2×n (or 3×n) matrix A, called the transformation matrix of T), suitable for computation. This format allows transformations to be conveniently combined with each other by multiplying their matrices. In this paper we first use matrices to represent points, lines and polygons. We then discuss in detail some linear transformations such as translation, scaling, rotation, reflections and shearing in 2D, and examine how transformations can be concatenated using matrix multiplication.
Keywords-points, Linear transformation, Rotation, Reflection, Shearing,
Introduction
The usefulness of a matrix in computer graphics is its ability to convert geometric data into different coordinate systems. A matrix is composed of elements arranged in rows and columns. In simple terms, the elements of a matrix are coefficients that represents the scale or rotation a vector will undergo during a transformation. The use of matrices in computer graphics is widespread. Many industries like architecture, cartoon, automotive that were formerly done by hand drawing now are done routinely with the aid of computer graphics. Video gaming industry, maybe the earliest industry to rely heavily on computer graphics, is now representing rendered polygon in 3- Dimensions. In video gaming industry, matrices are major mathematic tools to construct and manipulate a realistic animation of a polygonal figure. Examples of matrix operations include translations, rotations, and scaling.
Other matrix transformation concepts like field of view, rendering, color transformation and projection. Understanding of matrices is a basic necessity to program 3D video games. A. Linear TransformationIn particular, a mapping T: U->V of two vector spaces over the same field F is called a linear transformation if it has the following properties for all x, y U and a F: (a) T(x + y) = T(x) + T(y) (b) T(ax) = aT(x). Letting a = 0 and -1 shows T(0) = 0 andT(-x) = -T(x). We also see that T(x - y) = T(x + (-y)) = T(x) + T(-y) = T(x) - T(y). It should also be clear that by induction we have, For any finite sum, T(ai xi) = T(ai xi) = aiT(xi ) for any vectors xi V and scalars ai F. We will now take a more algebraic approach to transformations of the plane. As it turns out, matrices are very useful for describing transformations. Whenever we have a 2×2 matrix of real numbersM=we can naturally define a plane transformation TM: R2→R2 byTM(v)=Mv. That is, TM takes a vector v and multiplies it on the left by the matrix M. If v is the position vector of the point (x,y), thenTM(v)= TM( ) = = or equivalently, TM(x, y)=(ax + by,cx + dy ). While every matrix describes a plane transformation, not every plane transformation can be described by a matrix. Matrices correspond to a specific type of plane transformation which sends (x, y) to (ax + by, cx + dy ), for some real numbers a, b, c, d. A transformation TM arising from a matrix M obeys some "distributive laws". For any 2×2 matrix M and vectors v and w in R2, it is true thatM(v + w)= Mv + Mw and hence TM(v + w) = TM(v) + TM(w). Moreover, for any real number (scalar) c,M (cv) = cM v and hence TM (cv) = cTM(v). n fact, if a function F: R2→R2 satisfies these two distributive laws, then it must arise from a matrix. Why? If F (v + w) = F(v) + F(w) and F(cv)=cF (v), then for any point (x, y),F = F (using F(v + w)=F(v) + F(w)) = (using F(cv)=cF(v))Letting F(1,0)=(a, c) and F(0,1)=(b, d) then, we haveF=x = = ,so F corresponds to a matrix.