Scaling is just about increasing or decreasing the size of an object. Let us see an example, if a triangle has vertices of the size [a,b,c], then obviously a triangle with the vertices [2a, 2b, 2c] will be double the original size. Thus, to scale a triangle, we need to multiply each vertex with the scaling factor. We can also scale a particular vertex. For suppose, to scale a triangle using the vertex shader of the program, we need to create a uniform matrix and then multiply the coordinate values with this matrix. Further, we pass a 4×4 diagonal matrix having the scaling factors of x,y,z coordinates in the diagonal positions ( as it is the last diagonal position 1).