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 point is named by a lowercase letter. <br> a. True<br> b. False
Alik [6]
That is B False m8 that means mate btw xD please say thank you :P
4 0
3 years ago
Read 2 more answers
Blurring in a photograph can be due to _____ or ______.
scoray [572]
Do you have options? In my personal opinion, however, blur could be caused by motion blur, or focusing on the wrong thing, Hope this helps any!
4 0
3 years ago
Read 2 more answers
Two strategies for keeping your files in sync
zlopas [31]

Answer:

1. MS Cloud

2. G Drive

Explanation:

5 0
3 years ago
List two ways that search engines and electronic databases are similar and three ways that search engines and electronic databas
antoniya [11.8K]

Answer:

Explanation: search engine uses system algorithm to search out items or information as required by the user. Example is google, chrome.

Data base are archives where information could be retrieve. Its contain information such as publications, abstract,journals.

Search engine provides wide range of information depending on you request while database are mostly for academics related materials.

Data base- A good place to generate this information is library, archivals while journal, publiications are kept while search engine can be used anywhere you have an internet facilities.

In a data base, information is searched in an organized way. The collections are already well arranged in different cubicle search engine provides wide range of information not organized.

Data base may contain more complex information not easily understood, search engine provides more elaborate answers.

Similarity of the two is that they both provide information.

They are both reliable.

School library is an example of where journals and publication are kept and can be retrived.

6 0
3 years ago
Read 2 more answers
As an experienced networking professional, you are asked to conduct a posture assessment on a local credit union’s network. The
ale4655 [162]

Answer:1987

Explanation:guess

8 0
3 years ago
Other questions:
  • Which answer best describes an unsubsidized federal loan
    9·1 answer
  • Methods inherited from the base/super class can be overridden. This means changing their implementation; the original source cod
    5·1 answer
  • You are the network administrator for Slimjim, a peripheral device company. The network uses Linux, and you need information on
    10·1 answer
  • Buenas , ayudenme con esta tarea de excel 2016
    6·1 answer
  • Complete the body of the decrement static method using only the NaturalNumberKernel methods (multiplyBy10, divideBy10, and isZer
    10·1 answer
  • Which of these is an expansion slot type?
    5·1 answer
  • This isn't a question
    8·1 answer
  • I need help!! I decided to go back to college this year and am taking Intro to Logic and Programming. I have an assignment due t
    5·1 answer
  • The Internet is based on a U.S. government project called ________. Today, the Internet is a collection of networks, tied togeth
    5·1 answer
  • Tres areas donde se aplica la ciencia y tecnologia
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!