1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mr Goodwill [35]
2 years ago
6

Write a program in C/C++ to draw the following points: (0.0,0.0), (20.0,0.0), (20.0,20.0), (0.0,20.0) and (10.0,25.0). For this

purpose, you may use the GL_POINTS primitive.Write a program in C/C++ to draw the following points: (0.0,0.0), (20.0,0.0), (20.0,20.0), (0.0,20.0) and (10.0,25.0). For this purpose, you may use the GL_POINTS primitive.​
Computers and Technology
1 answer:
Fed [463]2 years ago
6 0

Introductory program; just a static picture of a colored triangle.
Shows how to use GLUT.
Has minimal structure: only main() and a display callback.
Uses only the default viewing parameters (in fact, it never mentions viewing at all). This is an orthographic view volume with bounds of -1..1 in all three dimensions.
Draws only using glColor and glVertex within glBegin and glEnd in the display callback.
Uses only the GL_POLYGON drawing mode.
Illustrates glClear and glFlush.
triangle.cpp
// A simple introductory program; its main window contains a static picture
// of a triangle, whose three vertices are red, green and blue. The program
// illustrates viewing with default viewing parameters only.

#ifdef __APPLE_CC__
#include
#else
#include
#endif

// Clears the current window and draws a triangle.
void display() {

// Set every pixel in the frame buffer to the current clear color.
glClear(GL_COLOR_BUFFER_BIT);

// Drawing is done by specifying a sequence of vertices. The way these
// vertices are connected (or not connected) depends on the argument to
// glBegin. GL_POLYGON constructs a filled polygon.
glBegin(GL_POLYGON);
glColor3f(1, 0, 0); glVertex3f(-0.6, -0.75, 0.5);
glColor3f(0, 1, 0); glVertex3f(0.6, -0.75, 0);
glColor3f(0, 0, 1); glVertex3f(0, 0.75, 0);
glEnd();

// Flush drawing command buffer to make drawing happen as soon as possible.
glFlush();
}

// Initializes GLUT, the display mode, and main window; registers callbacks;
// enters the main event loop.
int main(int argc, char** argv) {

// Use a single buffered window in RGB mode (as opposed to a double-buffered
// window or color-index mode).
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);

// Position window at (80,80)-(480,380) and give it a title.
glutInitWindowPosition(80, 80);
glutInitWindowSize(400, 300);
glutCreateWindow("A Simple Triangle");

// Tell GLUT that whenever the main window needs to be repainted that it
// should call the function display().
glutDisplayFunc(display);

// Tell GLUT to start reading and processing events. This function
// never returns; the program only exits when the user closes the main
// window or kills the process.
glutMainLoop();
}
You might be interested in
A non technical kind of cyber intrusion that relies heavily on human interaction and often involve tricking people into breaking
lana66690 [7]
Social Engineering.

---------------------------
4 0
3 years ago
Data values in a program are held in _________. a data types b names c variables d lockers
Tpy6a [65]

Answer:

Answered below

Explanation:

Data values in a program are held in variables. Variables are like containers for holding different types of data. A variable can be identified depending on the kind of data it holds. Variables can hold data types of integers, strings, arrays, lists, sets, Boolean etc. They hold unique data types and a can not hold different data types. Different rules exist for naming variables in different programming languages. A variable name should start with lowercase letters and be descriptive of the data it holds.

7 0
3 years ago
The ________ is responsible for the Internet's domain name system and the allocation of IP addresses. ICANN W3C ISOC IAB
Maurinko [17]

Answer:

ICANN

Explanation:

It handles the installation and processing of various databases related to network domains and provides a consistent and secure networking service and there are incorrect options are described as follows:

  • IAB, which provides a protocol for managing IETF, is therefore incorrect.
  • W3C is used in web development.
  • ISOC is used to provide Internet access.
7 0
3 years ago
Please help!
34kurt

Answer:

I don't know the exact fix to this because I don't know exactly what you're talking about, but I do suggest you instead just highlight with shift and the arrow keys to make it much simpler.

7 0
2 years ago
Angelina has added page numbers to her report, but all of the pages are labeled "Page 1" at the bottom. What caused
notka56 [123]

Answer:(A)

<em><u>Why?</u></em>

A footer is an area at the bottom of a document page that contains data common to other pages.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Should the federal government have bug bounty programs? Why or why not?
    9·2 answers
  • This morning when Paul turned on his computer at work, it would not boot. Instead, Paul reported that he heard a loud clicking n
    15·1 answer
  • A software program that includes tools for entering, editing, and formatting text and graphics is called a word processing progr
    14·1 answer
  • The individual accountable for ensuring the day-to-day operation of the InfoSec program, accomplishing the objectives identified
    7·1 answer
  • Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
    14·1 answer
  • Which 1898 film did George Melies create using camera trickery to create a illusion in which we now
    11·1 answer
  • The Counter Pattern
    14·1 answer
  • Which line of code outputs the decimal portion of a float stored in the variable x? print (x % 1000) print (x) O print (x / 1000
    13·1 answer
  • Remember that kid who would always ask you for your food, even though he packed his own lunch.
    8·2 answers
  • Identify the names of the following:<br><br>Please help me.​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!