Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that can solve this question. what we need to do is drawing in cpp using OpenGL. Plot an n-gon of radius

Write a C++ program that can solve this question.

what we need to do is drawing in cpp using OpenGL.

Plot an n-gon of radius 5 in a viewport of width = 200 and height = 200. The initial left and bottom of the viewport would be 100 and 100. Screen width and height are 640 and 480. The world window is from -6 to +6 for both lefts, right, top and bottom, the Initial number of sides of the n-gon would be 40. When drawing the n-gon set the colors according to the value of t (3) : a. Black: t -> [0, 0.25) b. Red: t -> [0.25, 0.5) c. Green: t -> [0.5, 0.75) d. Blue: t -> [0.75, 1.0]

image text in transcribed

2. Allow the user to draw the n-gon with points or lines with the press of the p key to toggle between points and lines (1):

image text in transcribed

3. Allow the user to decrease or increase the number of sides with the x or z keys. The number of sides of the n-gon should not go less than 3 or greater than 40 (1).

image text in transcribed

4. Allow the user to scale the n-gon with the q (zoom-out), and e (zoom-in) keys with a factor of 0.1 at each key press (1).

image text in transcribed

5. Allow the user to move the n-gon up, down, left and right by a movement of 0.5 if the user presses w, s, a or d keys (1).

image text in transcribed

6. Allow the user to move the viewport up, down, left and right by the movement of 10, if the user presses u, j. h, or l keys (1).

image text in transcribed

7. Allow the user to scale the viewport with y (scale up), and i (scale down) by 5 units at each key press (2).

image text in transcribed

N aphis App - My Graphics App ir Khade HTI # 1 - N aphis App - My Graphics App ir Khade HTI # 1

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago