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]
3 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]3 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 _____ is usually a smaller version of a data warehouse
Strike441 [17]
A ( micro ) is usually a smaller version of a data warehouse
4 0
3 years ago
In the 1960s, techniques were developed that allowed individuals to fool the phone system into providing free access to long dis
ycow [4]

Answer:

A

Explanation:

4 0
3 years ago
How do you change the order of the slides in your presentation within the outline pane? Drag icon up or down Delete slide icon C
Amiraneli [1.4K]

Answer:

Rearrange the order of slides

In the pane on the left, click the thumbnail of the slide that you want to move, and then drag it to the new location. Tip: To select multiple slides, press and hold Ctrl while you click each slide that you want to move, and then drag them as a group to the new location.

Explanation:

7 0
3 years ago
What is software?<br>....​
serious [3.7K]

Answer:

Software, instructions that tell a computer what to do. Software comprises the entire set of programs, procedures, and routines associated with the operation of a computer system. The term was coined to differentiate these instructions from hardware — i.e., the physical components of a computer system.

Explanation:

PA BRAINLIEST

HOPE ITS HELP

GOD BLESS

7 0
3 years ago
Read 2 more answers
When you use the Bing Image Search for online pictures, you will be searching the Internet for pictures that have been filtered
just olya [345]

Answer:

Creative commons licensing system

Explanation:

If you use the Bing image search you will be searching the Internet for pictures that have been filtered based on the creative Commons licensing system meaning you will have to search the internet for picture that have licence that will give you the right to have the pictures because the owner has given you the licence to share or use the picture he created

Therefore Commons licenses is the licenses to get permission to do any of the things with a work that the law reserves exclusively to a licensor and that the license does not expressly allow.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Manuel is working on a project in Visual Studio. He wants to keep this program showing on the entire desktop, but he also needs
    7·1 answer
  • Is a term used to define those providers or hospitals that have the capabilities and processes in place to be actively use certi
    15·1 answer
  • To what extent can u justify that computer is not the only ICT tool?​
    9·1 answer
  • What are the five layers in the internet protocol stack? What are the principal responsibilities of each of these lay?
    9·1 answer
  • The requester of sensitive information should not receive access just because of his or her clearance, position, or rank. The re
    15·1 answer
  • Why is the ketboard calledQWERTY
    11·2 answers
  • What technology did one of the student's have to learn to use in order to help him with his homework in the film, "Disconnected:
    11·2 answers
  • Write a program to find the principle amount​
    10·1 answer
  • How do u type please help
    11·2 answers
  • Web résumés allow you to include extra graphics and images that you would not include in a traditional résumé. please select the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!