Question: Write a simple paint program in C++ using OpenGL/GLUT. The program should support drawing several primitive types and multiple colors (like MS paint). Colors and
Write a simple paint program in C++ using OpenGL/GLUT. The program should support drawing several primitive types and multiple colors (like MS paint). Colors and shapes should be chosen via CLUT menus.
For each shape, implement your own drawing function. Cannot use built-int primitive types such as GL_lines etc, other than for points.
Left clicking should draw primitives in the current colour, of the current type (as selected from the menu).You should support the following shapes:
a) Points draw a dot at the point clicked with the mouse. Clicking and dragging should draw points constantly, i.e., free-form drawing.
You can use the GL_POINTprimitive for these
b) Linesdraw a line between two subsequently clicked points.
c) Rectangles draw a rectangle with top-left corner specified by the first click, and the bottom right corner specified by a second click.
d) Circlesdraw a circle centered at the position of the first click, with its radius set by a second click
(i.e., the length of the vectorbetween the two clicks).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
