This assignment deals with rasterization of triangles. Rasterization means converting vertex data into a set of pixels in a frame buffer which can be displayed to the monitor or window. Rasterizing triangles is a simpler special case to the rasterization of arbitrary polygons. The triangle case is simpler because there are laways exactly three verices. This can be used to make the required processing much simpler. Most hardware for rendering 3D graphics converts arbitrary polygons into triangles before rasterizing them.
For assignment 1 you will utilize the Starter Toolkit's primitive drawing functions to create a 2D triangle resterization function. You are not permited to use the Starter Toolkits "poly_fill" or "put_poly" routines. The only drawing primitive you may use is "put_line"
Your assignment consists of creating a function called "DrawTriangle" which will rasterize a triangle handed as input into the current window. You can draw the triangles in any color you like, but the default color is prefered. The prototype of the function is given below.
void DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3);You may create any auxiliary functions or data structures that you want, however the interface to your rasterizer MUST follow this prototype because we will be linking your code with our own test "main" routine to grade it. Your functions should be in a file named "assg1.c".
You will probably want to write your own test "main" function (IN A SEPERATE FILE) to test your rasterizer yourself. It should create a Starter Toolkit Window and call your "DrawTriangle" routine testing it against such special cases as
You are expected to hand in...