CS4390 Fall '98 Programming Assignment 2: Scan Conversion and Transformations Due: Friday October 23 Purpose: In this program, you will demonstrate your ability to implement line, circle, and ellipse scan conversion algorithms, and to perform 2D transformations on these primitives. Task: Write a program that renders the specified line, circle, or ellipse in a 300x300 interface window, then prompts the user to enter transformations to be executed on the object. The program will read in an input file (specified on the command line) that will denote the type of object, its color, and its position and size. YOU MAY NOT USE ANY HIGH-LEVEL OPENGL FUNCTIONALITY ON THIS PROGRAM. SEE BELOW. Circles and ellipses need only be rendered as an outline, not as a filled primitive. Input file format: The input file will consist of several components, which will be read in by code provided to you in the file ~cs4390/project1/read_input.c. -the first line denotes the type of object: 1=line, 2=circle, 3=ellipse -the next line denotes the object color: r g b (floating point) -for a line, there will be 2 more lines giving the endpoints -for a circle, there will be 2 more lines giving the center and radius -for an ellipse, there will be 3 more lines giving the center, major radius, and minor radius. What's given to you: All of these files are in ~cs4390/project2. The file read_input.c has a routine to read the input file. The provided Makefile will compile everything together if your program is called transform.c The file transform.h defines circle, line, and ellipse data types. The file transform.c is a simple main program that illustrates how to call the function to read the input file. It just prints out information about the object in the file. Sample input files will be given in ~cs4390/project2/input/. Your program should call the function "readObjectFile" with the name of the input file and pointers to a line, a circle, and an ellipse data type (defined in the file transform.h). This function will read the input file and return an integer specifying the type of object. The appropriate data structure will be filled in with the values from the input file. This is to make your life easier! Be sure to include transform.h in your C file. Transformations: Your program should prompt the user for a transformation on the command line after the initial drawing of the polygon, and after each successive transformation. It should read in and execute the following: -translations ("t "): translate the object by x-trans and y-trans in world coordinates -rotations ("r "): rotate the line by degrees with the first endpoint as a fixed point (rotations do not apply to circles or ellipses) -scales ("s foobar.uue Finally mail this file to cs4390 using the command mail cs4390@cc your_acct@cc