Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

Define Type I and Type II errors.

Answered: 1 week ago

Question

Why grant management important to a nonprofit organization?

Answered: 1 week ago

Question

8. Managers are not trained to be innovation leaders.

Answered: 1 week ago