Sizing Objects Using Scaling

5 minutes
Share the link to this page
Copied
  Completed

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).

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.