This lab will serve as an introduction to opening windows in Glut, working with pixels and their colors, reacting to mouse events, and rendering simple shapes. It is out of 65 points, so a maximum of 70/65 is possible when fulfilling the criteria below.
You can use the code provided as your starter code, or write your own. The program should load an image when started, but initially display a blank canvas. When the user drags the mouse over the canvas, convert the mouse movements into paint strokes and paint the original image onto the canvas. Check the 'Grading / Requirements' section below for the specifics that you'll be graded on.
Starter Files (MSVC++ 2012 solution included)
Tutorial on setting up a Visual Studio project (not required)
Value | Description |
---|---|
5 | Load image file named on the command line |
5 | Display a help message about what the mouse and keyboard do |
5 | Present a window/the blank canvas |
5 | Draw a correct colored rectangle when you cilck |
5 | Draw continuously when you drag |
10 | Orient the stroke in the direction of mouse motion (for at least one brush shape) |
10 | Something that looks like the source image appears when used |
5 | Provide keystroke or menu to clear the canvas |
5 | Provide key or menu to change brush size |
5 | Provide key or menu to change brush shape (at least three shapes including circle and thick line) |
5 | Don't Crash! - For example, when mouse is dragged out of window, or when bogus filename given. (demonstrate this in your video) |
5 | Provide an eraser |
In bold above are some clarifications that have been added to the assignment. First, for changing brush shape, you must implement at least the following three brushes:
Related to this restriction, the points for orienting the stroke in the direction of the mouse apply to brush #3 above: your custom brush should include some orientation-dependent component (like a square or a series of lines) that changes orientation as the direction of mouse motion direction changes. That is, dragging the mouse up-and-down across an area should produce a different pattern than dragging it left-to-right across the same area. Of course, not all of your brush shapes ahve to be orientable (the circle brush shape won't be, for example).
Finally, make sure to demonstrate that your program doesn't crash when you drag the mouse outside the canvas area in your video.
This link points to an exmaple submission to give you an idea of what your video submission should look like. Note that this submission does not include stroke orientation or a continuous brush style, so it wouldn't receive a perfect score, but it does do a good job of explaining what is going on and walking through the list of features. Note that you don't have to record audio: using captions is perfectly fine as long as the video clearly explains what's going on.