Due Dates: Part 1 - Wed. 4/23/97, Part 2 - Mon. 5/5/97
This lab is designed to give you experience with 2D transformations, windowing, line/polygon clipping, and animation.
Part 1
Write an application program that uses the routines in lab2part1Routines.o and lab2part1OutputRoutines.o to demonstrate that you understand the concepts of 2D transformations, animation, and "windowing". Your application program should minimally do the following:
NOTE 1: Examples of previous student work is available by running ~icss570/xdemo2.sgi or ~icss570/xdemo2.sparc. These are scripts containing two different sets of student work.
NOTE 2: All the file names that are referenced pretain to files provided in the /usr/local/pub/ncs/graphics/lab2 directory. The filenames will be referenced assuming this directory name as part of the filename, i.e., if the filename referenced is README, its absolute name is /usr/local/pub/ncs/graphics/lab2/README.
NOTE 3: lab2part1OutputRoutines.o and lab2part1Routines.o are available in the directories part1.sgi and part1.sparc compiled for the sgi's and sparc's, respectively.
NOTE 4: Sample makefiles for the sgi's and sparc's are provided in sgipart1makefile and sparcpart1makefile, respectively. Note that these makefiles are organized so that you do NOT need to copy lab2part1OutputRoutines.o, lab2part1Routines.o, nor any of the .h files needed for the lab.
NOTE 5: The routines you will use from lab2part1Routines.o are:
NOTE 6: lab2Externs.h contains the interface specifications.
NOTE 7: lab2part1OutputRoutines.o contains "mySRGP" output routines similar to those that you implemented in lab 1. In all cases though the current composite matrix CM and then the viewing transformation defined by the Window and Viewport specifications are applied to all of the vertices before the SRGP output primitives are executed. The routines available are mySRGP_line, mySRGP_polyLine, mySRGP_rectangle, mySRGP_polygon, mySRGP_fillRectangle and mySRGP_fillPolygon. (See lab2OutputExterns.h for the "mySRGP" interface specifications - same as for SRGP.)
NOTE 8: A lab2Ellipses.h and lab2Ellipses.o are also provided for filled and unfilled ellipses. These may be used for both part 1 and part 2. (PLEASE NOTE THAT ELLIPSE ROTATION WILL FAIL!!!) If you chose to use them you will need to modify your makefile for part 2 to reflect linking to the appropriate directory from part 1, i.e., part1.sgi or part1.sparc.
NOTE 9: 15 percent of the grade for part 1 will be based (subjectively) on the how interesting/complex your design is.
Part 2
For part 2, you will implement the routines used in part 1. lab2Externs.h and lab2OutputExterns.h are available for your use as are template files for the lab2OutputRoutines.c and lab2Routines.c.
Assuming that Matrix defines a 2X3 floating point array (specified in lab2types.h), implement the following routines:
NOTE 1: You may also need to modify your lab2Outputroutines.c to utilize both the composite matrix, the viewing transformation matrix and the clipping that is implicit in the latter. (I believe the template_lab2OutputRoutines.c already does this, but if, for instance, you want to use ellipses in your application program, you may need to make modifications to it.)
NOTE 2: The directory lab2testdir contains a sample makefile (testmakefile) and testcases to help you debug part 2. Executables are also provided for both the sgi's and the sparc's in lab2testdir/exec.sgi and lab2testdir/exec.sparc, respectively. See the README file for details.
For Part 1, you are to submit a directory called lab2dir using the following command:
submit -v paw-grd lab2part1 lab2dir
where lab2dir contains your application program (BE SURE TO NAME IT lab2.c), a READ_ME file (please include a hardcopy in the front of your lab folder), stating what your application program is showing in each frame, and a makefile. (No .o files or executables, please)
The makefile should include a target lab2, i.e., I should be able to type
make lab2
which should compile your application program and create the executable file lab2.lib. This is to be created by linking your application program with lab2part1OutputRoutines.o and lab2part1Routines.o.
For Part 2, you are to submit a directory called lab2dir using the following command
submit -v paw-grd lab2part2 lab2dir
where lab2dir contains the files lab2Routines.c, lab2OutputRoutines.c and your application program from part 1 (no .o files or executables please.)
The makefile should include a target lab2, i.e., I should be able to type
make lab2.
This should compile the source files and create the executable file lab2.yours, which is to be created by linking your application program with your implementation routines.
Grading:
Your overall lab grade will be based on the following: the implementation of required routines, the demonstration of the required routines, the complexity (how interesting) of graphical output, internal documentation, and program design.
When the grader begins grading your program, if there are any problems with the submittal, the grader will send you e-mail and you must then resubmit within 24 hours. Incorrect submittals are subject to penalties!
Hardcopy:
Hardcopy of all files including all of your .h and .c files, the makefile and the READ_ME file should be submitted on the day following the due date for each part.