next up previous


Computer graphics Programming Assignment 2


Image Processing
Due date: Monday, February 22, 11:59 pm

Overview

Write a program that performs two tasks: line drawing and scan conversion for polygons with texture mapping. The program should be interactive, that is, the endpoints of the lines and the vertices of the polygon should be defined interactively by the user. Switching between the two modes can be done using the pull-down menu.

In this assignment only, you should not use OpenGL functions for drawing lines and polygons. Create an internal array of RGB values, and do all drawing there; display the image using OpenGL raster functions glRasterPos,glDrawPixels.

Your program should do the following:

For the purposes of calculating the transformation, assume that the coordinates in the image extend from -1 to 1 in x and y directions.

Assume that vertices of the quadrangle are picked in order, i.e. the point of the image with coordinates (-1,-1) should map to the first point, (1,-1) to the second picked point, (1,1) to the third and (-1,1) to the last. Check the input for validity, i.e. detect and refuse to accept concave and self-intersecting quadrangles, and quadrangles with three vertices on one line.

What to turn in

A working version of your program; also, generate images of the checkerboard with four vertices approximately in the following positions:

All coordinates are normalized to the ranges -1..1, -1..1; to get pixel coordinates, use appropriate translation and scaling.

The checkerboard image is NOT the one from the previous assignment; a new one will be posted on the net for this assignment.


next up previous
Denis Zorin