Spring 1995
Copy Some Files
Some basic graphics utilities and the animation tool's main program are provided for you. So, before you begin programming, you will need to copy seven files from the directory /usr3/faculty/sclaroff/program2 on the CGL cluster. These are:
Like the last assignment, you are expected to complete the program by providing two missing subroutines using the code templates.
Run the Example Animation Tool
In the same directory, you will also find an example of a fully functioning animation program. You may run this to see how your program should work. To run the program, type
animate_example filename.poly
where you specify a polyline file as input. There are two polyline files provided in the assignment directory: box.poly and figure.poly . These are text files and have a straight-forward format.
The user interface to the animation tool is through a seperate user interface window. This window has sliders and buttons. The sliders control the transformation parameters for: rotation, translation, scaling, shearing, and bending. Beside each slider there is a small button that you can push to reset it's value to the default values.
There are also three buttons on this menu:
You are expected to write two new routines based on the templates provided in the files transform.c and clip.c :
When transforming the points, do the non-rigid transforms first, then scaling, rotation, and translation. Also be sure to rotate around the polyline's center point, which is stored in the polyline structure.
em There are comments in the two template files that will help guide you in writing your own subroutines.
Test Cases
There are no test cases provided in this assignment. You should instead make sure that you final program can correctly clip and transform the polylines.
Grading
Demo
As in the previous assignment, part of your grade for this programming assignment will be based on your giving a 4 minute demo in the CGL cluster. You will be expected to talk about how your animation tool works, and we will test it on a few examples. Demos will be scheduled for Monday Feb. 27, from 1:00 to 5:00. You will be asked to sign up for a slot by next Wednesday. Write-up
You will also be graded on a very brief write-up that is to be turned in at the beginning of class on Moday, Feb. 27. Basically, this write-up should include a paragraph describing what design choices you made in writing your subroutines, and hard copy of all your code. The code should be commented so that it is easily understood.
Extra Credit
For extra credit, create your own animation with the animation tool. Modify the subroutine playCB to play your animation. You may also want to define your own polyline files, or you may want to modify the program to handle multiple polylines.
Start programming early. Late assignments will not be graded.
Utilities provided
The file draw.c contains utilities for opening and managing windows:
There are also polyline and clipping frame management routines:
There are also routines for drawing:
The file menu.c contains routines that manage the user interface widgets. You don't need to look at these unless you want to.
Finally, animate.c contains some routines that are called whenever the user moves something on the user interface menu. These routines are called ``call back'' routines, because the user interface calls back to them when an interaction event occurs. These routines are:
You will notice that there are some global variables declared in animate.c . These are needed to support the user interface's call-back routine structure.
Stan Sclaroff
Created: January 17, 1995