Assignment 5: Finding the visible area of a guard inside an art gallery

Assume you start with an input polygon (2D) that represents the plan of an art gallery, and a point inside this polygon that represents a guard. Implement an algorithm that computes and displays the part of the gallery visible to the guard.

The interface should be as follows: Initialize a polygon based on the user's mouse clicks. Initialize a guard inside the polygon based on the user's mouse click. Then 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.

Some things to think about:


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:

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.

And finally, if your code has bugs, you need to make it to the study group and talk to Max (the TA). He may not be able to tell you exactly what is wrong, but going over your code with someone else may show you what's wrong. I've been in many situatiosn where someone would walk me through their code, only to find out the problem as they were explaining how it works.

Enjoy!