2-D Transforms and Viewing Pipeline
Eric Leive, Xiang Lan Zhuo

Functions implemented

Matrix operations
  • identity_3x3()
  • multiply_3x3()
  • vector3Transform()
  • clear_3x3()
  • clear_vector()
  • print_3x3()
  • copy_3x3()
  • point_vector()
  • vector_point()
  • transform()
Transformation matrices
  • translate2D()
  • scale2D()
  • rotate2D()
  • scaleArbitrary2D()
  • rotateArbitrary2D()
  • VTM()


Global Transformations

In our transformation matrix operations, we first defined the matrix necessary for the specified transformation. In order to map the transformation onto an already existing matrix, we multiplied the 2 matrices and return the passed in matrix after it's modified. Different transformations can be achieved in series by multiplying our final matrix by these predefined matrices of specified transformations. To map the final transformation to a point of type Point_t, we needed to represent our point in a 3x1 matrix (vector of 3). After the vector is modified by pre-multiply it with the final transformation matrix, it is changed back to type Point_t. Because all the vector-point and point-vector translation can be tedious while coding, we implemented a transform(Point_t t, m3x3_t m) that will map the transformation and returns the point instead of a vector

Viewing Pipeline Transformations

For the viewing pipeline, we must first specify the new viewing window by its lower left corner and its upper right corner. The transformation to change the viewing window consists of first translating the lower left corner to the origin, then scale each part to the size of the original image.

Model Manipulation

Once the code is in place, making the Enterprise is just a matter of transforming a unit square to the different parts of the ship. The process is simple as long the number of parts are within a manageable limit. In our case, the ship is made by 5 individual parts.

Making Animated Gifs

Each animated gifs are made with 10 different frames each at a rotation of frame*(2*pi/10).

Images