In this assignment the goal is to find the visible area of a guard (point) inside an art gallery (a polygon).
Generally speaking, assume you have an input polygon (2D) that represents the plan of an art gallery, and a point inside this polygon that represents a guard. Your task is to implement an algorithm that computes and displays the part of the gallery visible to the guard.
This assignment is split into two parts.
For extra credit: Implement an O(n lg n) algorithm, where n is the size of the polygon.
For extra credit: add more than one guard, and render the visible area transparently, so that the overlap is easy to see.
Once the polygon and the guard are set, run your algorithm that computes that polygon that's visible and render it with a different color
To see some simple OpenGL examples on how to use the mouse, look in: Code/mouse.
Below are some explanatory images:
glPolygonMode(GL_LINE); //glPolygonMode(GL_FILL);
How to turn in: Please use the svn folder provided for the class! If you would like to change partners, just come talk to me or send me an email, and we'll create new svn folders for you.
The usual comments:
Start early. Always code assuming you'll have to debug. Think and structure your code incrementally so that it is easy to debug it. Test one piece before you move on to the next one. Keep in mind that pointer errors do not always manifest, and soemtimes they manifest in different ways on different computers. Start early.
Team work: Please give me feedback on how your team works. If I don't hear any feedback from you I assume your team is working well. If at any point you would like to work alone or change partners, email me so that I can ask DJ to update the svn folders.
Enjoy!