google search

Tuesday, October 5, 2010

2D TRANSFORMATIONS

The ability to perform transformations on objects in an image is an important feature of a graphics system. Operators were added to this system which allow the user to create 2D transformation matrices that perform the following transformations:

  • scale around (0, 0)
  • scale around an arbitrary point, with the x-scale direction oriented to a specified angle
  • translate
  • rotate around (0, 0)
  • rotate around an arbitrary point
In addition, helper functions were created that perform matrix multiplication, reset a matrix to the identity, reset a matrix to the zero matrix, and print a matrix. Below are some sample images created using these methods. The original polygons are in red, and the tranformed ones are in blue. The images are of translation, rotation of PI/4 about (0, 0), rotation of PI/4 about (80, 40), scaling by .8 in x and y, and respectively.

0 comments:

  © Blogger templates ProBlogger Template by Ourblogtemplates.com 2008

Back to TOP