C481 B581 Computer Graphics
Dana Vrajitoru
Homework 6

Due date: Monday, March 14.

Preparation. Download the Sierpinski gasket program that we have seen in class and the Makefile:
my_gasket.cc
Makefile

Another example of a simple program that draws a circle:
curve.cc

Ex. 1 Write a program that reads a list of points from a file and displays them as a line strip. The file is composed of a list of numbers and has the following structure:
nr of points
point1_x   point1_y
point2_x   points2_y
...

A line strip starts with the command
glBegin(GL_LINE_STRIP);
and ends with a glEnd();

We are going to suppose that the points are in general in the rectangle defined by left = -10, right = 10, bottom = -10, top = 10.
Here are two examples of such a files:
spiral.txt
circle.txt

Set the title of the window as "Plot from file", or something like that and define the background color (glClearColor) and the color applied to the lines (glColor3f) any way you want.

Ask the user for the file name and input it with a cin usual statement.

Turn in: source code  in electronic form.