Create a Java applet which has the following functionalities.
When the user right clicks, a pop-up menu will appear, with the following options:
- current mode:
Draw
Edit
- current color:
Red
Green
Blue
- current operation:
Translate
Scale
Rotate
Fill
Delete
The application can run in two modes, chosen from the “current mode” option:
When the “Draw” mode is selected, the user can draw the object as it follows: by using
the left click, he will give consecutive points of the polygon, in different coordinates of
the window; when he right clicks, the polygon will be closed and drawn (not filled, just
the contour).
When the “Edit” mode is selected, the user can select one of the previously drawn
polygons by left clicking on them. When an object is selected, some of its attributes
should change (highlighting it, changing its line type etc.). In addition, when an object is
selected, the user can perform some operations on it:
- Translate: move the object by using the mouse (dragging it)
- Rotate: rotating the polygon around its center
- Scale: scale the polygon (making it bigger/smaller)
- Fill: fill the object with the currently selected color
- Delete: erase the object from the canvas.
Important note! If two or more objects are intersecting, the operations (translate, fill, delete)
should be applied to the entire group of objects.
OpenGL -->
By using C++/Java and OpenGL (including glut / freeglut libraries), write a program with
the following functionalities:
When the user right clicks, a pop-up menu will appear, with the following options:
- draw an object
- current object
Cube
Sphere
Cone
Teapot
Dodecahedron
- current color:
Red
Green
Blue
- current animation:
Translation
Scaling
Rotation
- quit (close the program)
When the user selects “draw an object”, the currently selected object will be drawn, using
the current color and animation.
The position of the objects can be chosen by you. When a new object is drawn, the
previous ones will not be removed (we will have all objects on the screen).
Implement also some keyboard functionalities (choose one):
- Change the objects from solid / wireframes when pressing specific keys
- Implement a camera to navigate in your scene using the keys