Question: line drawing with OpenGL Given five vertices v 1 = (0, 80), v 2 = (-30, -60), v 3 = (70, 0), v 4 =
line drawing with OpenGL
Given five vertices v1 = (0, 80), v2 = (-30, -60), v3 = (70, 0), v4 = (-70, 0), v5 = (30, -60), and a set of stipple patterns for line drawing below (a shaded cell represents 1 and a white cell represents 0), assuming factor=1, modify the program so that it replaces the smiley with an image determined by the five line segments (v1, v2), (v2, v3), (v3, v4), (v4, v5), and (v5, v1) (keep the X- and Y-axis unchanged). The program should allow a user to determine whether the line segments are displayed in solid or one of the given patterns before they are drawn. You may determine the color and width of each line segment as you wish.
Note:
1) When you need to use header file iostream in your program, include it before including file glut.h.
2) Since a display-callback function does not accept any parameter, a global variable is needed if one wants to pass a data value into a display-callback or a function called either directly or indirectly by a display-callback.
3) You may add operations for user input in function main( ) or a function called either directly or indirectly by function main( ), but NOT in the display-callback function or a function called either directly or indirectly by the display callback function (you will learn the reason later).
4) Carefully design your user interface, so that a user would know exactly what to enter.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
