description.
For the first part of this lab, we developed basic matrix manipulation routines that will help us with 2D (and later 3D) transformations. We coded algorithms that transform, scale or rotate matrices as well as algorithms that set the matrix to the identity matrix or multiply two matrices and do other mathematical operations and combinations of scaling, rotating and transforming.
For the second part, we created a model of the Enterprise using a unit circle (which can be represented as a single vector starting at the center and going to an arbitrary point on the actual circle) and a unit box. By scaling and translating the unit box, we were able to get all of the five rectangles we needed.

In the third part we made an animation of the Enterprise rotating around a planet and to do this, we used the viewing pipeline we implemented for part 4 of the lab.

questions.
1. Who did you work with on this assignment, and what tasks did each of you do?
Heather, Adem and Nick worked together on this assignment. Heather wrote the matrix functions and made the animation of the Enterprise rotating around a planet. Nick debugged the code and added the viewing pipeline and did the planet eating the Enterprise animation while Adem helped nick with some of the debugging and did the two simple animations (fish and the migrating Enterprises) and the website.
2. Describe the mechanism you developed for handling the global transformation parameters and matrix.
All of our algorithms took pointers to the matrices (or vectors) and then modified them. We had one LTM and we sent that to our algorithms for necessary modifications and after the LTM was complete we multiplied the vectors by the LTM.
Since the vectors were changed during the process and we didn't want to create new vectors for each frame in the animation, we made a copy of the vectors before multiplying them by the LTM. When the transformation was complete and a frame was created, we used the back-up copy to reinitialize the vectors.
3. Describe the mechanism you developed for handling the viewing pipeline parameters and transformation matrix.
To handle the viewing pipeline we created a function that took two vectors (low-left and up-right) and the number of rows. This function first initialized the VTM to the identitiy matrix, then moved the viewing window into the fourth quadrant with top-left corner at origin and then scaled it to the size of image. Finally it flipped into image coordinates.
4. Once you had the code in place, what was the process and how difficult was it to modify the view window and the position of the Enterprise?
These are the steps we follow to make the view window :
* define the vectors for the object
* define the LTM using necessary functions - rotate, scale, translate. multiply the vectors by LTM.
* multiply the vectors by VTM to get the actual view vectors
* convert vectors to points
* use scanfill or polyDraw to draw the object.
Once we had the code in place, it wasn't difficult to modify the view. With a few lines of code we could place the Enterprise whereever we wanted with any orientation and size.
extensions.
We extended this assignment in a coule of ways:
1- A simple animation:

With this animation we wanted to show that we can scale, rotate, translate, duplicate an object. The green fish changes its size (scaling), the orange fish rotates and the yellow fish moves around (translation). The red one has no idea what it's doing; it's rotating, rescaling himself and moving around a little.
2. Creating an interesting animated gif sequence:
We thought it would be interesting if the Enterprise didn't go around planets so easily. In this animation, we showed how we could move, resize, rotate and scale the Enterprise.
3. Creating multiple copies of the Enterprise:

In this animation, we created multiple copies of the enterprise without much coding. We had about 8 lines of code for each enterprise and the whole 30 frames used in creating this animation took about 60 lines.
|