|Home | People | Curriculum | Projects | Resources | Media|
Monday, September 22
Mouse & Keyboard Interaction, and 2D Transformations, with OpenGL
Design and implement a C++ program using OpenGL calls to permit the user to point to a position in the drawing window and click to draw a shape using the following scheme:
The position of the mouse click indicates the center of the shape. The size of the shape should be (roughly) 30-50 pixels "diameter". You are welcome to experiment with "click and drag" for drawing these shapes, then the size is variable [+10].
The lab is completed as follows:
void DrawSquare(point where)
void DrawTriangle(point where)
bool validClick(point where): using the size of the shape, determine if the position is valid, defined as far enough away from the window edge so that the complete shape can be drawn.
T' key is entered. You will need to save a representation of each shape, including it location, in some type of list, basically saving the universe.
Links for CS212 -- Other CS212 Assignments: 0 1 2 3 4 5 6 7