|
EXERCISES FOR WEEK 2
|
| week2-1 |
Use the demo program horiz_stripes3.cpp as a guide to write a display function that draws vertical stripes instead of horizontal stripes.
|
| week2-2 |
Now put the horizontal stripes and vertical stripes together in the same program, using multiple windows. Have one window display horizontal stripes and a second window display vertical stripes. |
| week2-3 |
Add a third window to the program you wrote in exercise 2 so that it displays a "checkerboard".
|
| week2-4 |
Suppose you have called glOrtho(0.0, 10.0, 0.0, 6.0, -1.0 1.0) and you are using the default viewport (entire screen window). The screen window width is 600 pixels (0 to 599) and its height is 400 pixels (0 to 399).
|
| week2-5 |
Suppose you have called glOrtho(-10.0, 10.0, -6.0, 6.0, -1.0, 1.0) and you are using the default viewport (entire screen window). The screen window width is 600 pixels (0 to 599) and its height is 400 pixels (0 to 399).
|
| week2-6 |
What is the aspect ratio of the real window frame defined in the previoius exercise? If you are still using the default viewport,
|
| week2-7 |
If you want to preserve the aspect ratio of the real window frame defined in exercise 7, but must use a square screen window (800 by 800 pixels), what values would you use for left, bottom, width, height in the call to
so that the viewport is centered both vertically and horizontally in the screen window and uses as much of the window as possible?
|
| week2-8 |
Re-do exercise 9 using the real window frame defined by:
|
| week2-9 |
Do exercise 3.2.1 on page 958of the Hill textbook. *Don't skip this one.
|