Praktikum 01

must be demonstrated by: Fri, 03.July at 12:00


Write a C++ program (console based, NO OpenGL) which:
• Prompts the user for a time (in hours and minutes)
• Outputs a clock face to the console window

One purpose of this assignment is for you to gain some familiarity with rasterization, so you should use a two-dimensional array (square, same number of rows and columns) of type char to mimic the frame buffer.

Your clockface should be symmetric with the same number of rows and columns. You should be able to change the size of your clock face at compile-time (or run-time if you wish). So don’t hardcode any buffer entries. Note that your output will might not look square, if the aspect ratio of the characters in the console window is not equal to one, but that is OK.

For instance, the output corresponding to 2 hours, 20 minutes would look like the console window below.

You might find the DDA Algorithm covered in lecture helpful, but you are not required to use the DDA algorithm if you have a preferred method for rasterizing.

Please answer the questions below, by putting them in comments at the top of your code. They are reflections on the implementation of your "rasterized" clock-face. The instructor will discuss these with you when you demonstrate the code.

1. What factors contribute to the problem with aliasing?
2. What did you do to ensure you had continuous clock hands?