You will develop an OpenGL program that allow a user to perform 2D affine transformation, including
translation, scaling, rotation, on a 2D object (e.g., a solid square), by selecting an transformation item
from the popup menu. In this project, you can have two-layer menu as follows:
– Horizontal increment
– Horizontal decrement
– Vertical increment
– Vertical decrement
– Horizontal enlarging
– Horizontal shrinking
– Vertical enlarging
– Vertical shrinking
Your code will need to maintain several geometry parameters of an object, including horizontal and
vertical translation, orientation, and scaling factors. You code should include a function (called menu),
in which you should update the geometry parameters of the object.
The object should be “complicated”, i.e., a composition of at least 2 OpenGL geometry primitives.
The following parameters should be used for an individual 2D transformation:
• 10 pixels for horizontal increment/decrement
2• 2 for horizontal enlarging, and 0.5 for horizontal shrinking
• 20 ◦ for a rotation.
students should explicitly construct a transformation matrix in order to perform a speci-
fied 2D transformation to the object. The transformation matrix is represented as a one-dimensional
array in OpenGL that is used as a parameter for the OpenGL function glMultMatrix() to update
the current transformation matrix.
students should also implement a simulation of moving the object. Specifically, the object
is moved around a circle track clockwise and be back to its original position. So it is basically a
task of performing a sequence of translations on the object.