C481 B581 Computer Graphics
Dana Vrajitoru
C481/B581 Homework 2

Due date: Monday, January 30.

Ex. 1 Download the following files in a separate folder (you don't want to mix the main.cc and the Makefile with those of another program). The name of the executable is now "illusion":
Makefile
glheader.h
interface.h
interface.cc
illusion.h
illusion.cc
main.cc

Compile and run the program. You should see the following result:

Ex. 1. Lens Illusion. Complete the function lensIllusion in the file illusion.cc to create something similar to the following image:

For this, add two loops to the function, one for horizontal lines and one for vertical lines. For example, if the control variable for the vertical loop is i, (starting from 1, incremented by 1) in each iteration you should create 2 lines similar to the ones given as example, but where the distance between the lines in the previous iteration and the new one is equal to i * gap in each iteration, both increasing from the left, and decreasing from the right. The loop should end when the new vertical lines pass the middle of the image (width/2). A symmetrical idea applies to the horizontal loop.

Ex. 2. Interface. Improve the interface of the program with the following features. You can (and should) add your own functions for the more complex operations. Don't forget to add their prototypes to the header file if necessary and to submit the header file too in that case.

Upload to Canvas: all the source files that you modified, to Assignments, Homework 2.