Matrix6383
February 28th, 2005, 01:00 AM
Hi everyone, I have an Assignment for my OpenGL Class that I have been working on for three days but I have still gotten no where. I have searched every where on the internet on how to implement requirements (a) and (b) below but all I get is more confused. My teacher refuses to help and I have no where else to turn, could someone please explain with some coded examples how to solve the problems below? Any help would be GREATLY appreciated....
Thanks,
Jon a.k.a. Floundering Student
Assignment One. Due time: 9:30am on Tuesday March 1, 2005
(15% of the total course grade, total 300 points are used for the grading scheme of this programming project)
The main objective of this programming project is to learn several important two dimensional graphics techniques and apply them (i.e., line drawing, scan-conversion, two-dimensional transformations, etc.) to solve real-world problems in practice. Please write an OpenGL program that implements the drawing of a polygon boundaries as well as its interior and be able to handle standard two-dimensional transformations and manipulations. In particular, the entire project must consist of the following six major functionalities (you MUST use draw-point function for drawing tasks):
(a) (50 points) Draw all the line-segments of any user-specified polygon using the mid-point algorithm. Your program should allow users to interactively enter positions (including both x coordinate and y coordinate) of a set of vertices that define the polygon via mouse buttons. Your program should try to use different buttons for different purposes. For example, left mouse click indicates a new vertex, and right mouse click indicates the end of input process, hence a closed polygon should appear when you click on your right button in this scenario, please feel free to make your own choices.
(b) (50 points) Detect if the input polygon is a simple polygon by checking whether any two line-segments intersect with each other besides their end-points. Please provide users any meaningful visual feedbacks whenever the self-intersection occurs.
Thanks,
Jon a.k.a. Floundering Student
Assignment One. Due time: 9:30am on Tuesday March 1, 2005
(15% of the total course grade, total 300 points are used for the grading scheme of this programming project)
The main objective of this programming project is to learn several important two dimensional graphics techniques and apply them (i.e., line drawing, scan-conversion, two-dimensional transformations, etc.) to solve real-world problems in practice. Please write an OpenGL program that implements the drawing of a polygon boundaries as well as its interior and be able to handle standard two-dimensional transformations and manipulations. In particular, the entire project must consist of the following six major functionalities (you MUST use draw-point function for drawing tasks):
(a) (50 points) Draw all the line-segments of any user-specified polygon using the mid-point algorithm. Your program should allow users to interactively enter positions (including both x coordinate and y coordinate) of a set of vertices that define the polygon via mouse buttons. Your program should try to use different buttons for different purposes. For example, left mouse click indicates a new vertex, and right mouse click indicates the end of input process, hence a closed polygon should appear when you click on your right button in this scenario, please feel free to make your own choices.
(b) (50 points) Detect if the input polygon is a simple polygon by checking whether any two line-segments intersect with each other besides their end-points. Please provide users any meaningful visual feedbacks whenever the self-intersection occurs.