Interactive Polygon editor OpenGL

Job ID: 34852103

Budget: $30 – $250 USD

The first task in this project is to write a polygon editor program based on the following description:

1. The vertices of the polygon are defined in a row by pressing the left mouse button.

2. When you press the right mouse button, on the border (at the edges of the polygon), a new point (not necessarily an already existing vertex) closest to the cursor is added, and it is connected between the start and end points of the edge segment. Until the right mouse button is released, this new vertex follows the movement of the cursor, while the polygon is also deformed.

3. The polygon can be made more smoothly curved with the 's' key, the algorithm of which is as follows: A Catmull-Rom spline with a tension of -1 is fitted to the existing peak points, and a spline point corresponding to the arithmetic mean of their parameters is fitted between two existing points.

4. The polygon can be simplified with the 'd' key, as a result of which the number of vertices of the polygon is halved. We discard those vertices whose discarding minimally modifies the shape of the polygon, i.e., for which the distance between the discarded vertex and the resulting new edge is minimal.

The completed project should contain one cpp file.
Must use the given framework files (.cpp, .h).
Attached a picture of the expected display of the program, along with ideas about the Catmull-Rom part.

Next part of the project released after completion.

Feel free to ask any questions!
Related categories: C++ Programming Computer Graphics OpenGL