/******************************************************************** File: illusion.cc Author: Dana Vrajitoru Project: Optical illusion Last updated: January 23, 2017. Functions creating the content of the window ********************************************************************/ #include "glheader.h" #include "illusion.h" #include #include using namespace std; // display an optical illusion that creates a lens effect by drawing // lines from the sides of the window towards the center at increasing // distances from each other void lensIllusion(float gap, float color[], float width, float height) { glColor3f(color[0], color[1], color[2]); glBegin(GL_LINES); glVertex2f(gap, 0); // vertical left glVertex2f(gap, height); glVertex2f(width-gap, 0); // vertical right glVertex2f(width-gap, height); glVertex2f(0, gap); // horizontal bottom glVertex2f(width, gap); glVertex2f(0, height-gap); // horizontal top glVertex2f(width, height-gap); glEnd(); }