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
Someone help me out eh?
Elodia [21]

Line 4

It should be font-size: 15px

Also there should be curly braces in line 5.

6 0
2 years ago
Read 2 more answers
How have you improved the technology function to provide the right services at the right price and right level of quality?
kaheart [24]
What did you do? Write that as the first part
7 0
2 years ago
Which statement best describes the types of products and services that are suitable for online sale?
garri49 [273]

A statement which best describes the types of products and services that are suitable for online sale is: D. Not all products or services are well-suited for sale on the Internet.

<h3>What is e-commerce?</h3>

E-commerce is also referred to as an online sale and it can be defined as a business model which is designed and developed to involve the buying and selling of goods (products) over the Internet.

Basically, e-commerce technologies are designed and developed to comprises software and information technology (IT) systems which typically support safe and secure transactions over network and the Internet, so as to make e-commerce possible.

<h3>What is a product?</h3>

A product can be defined as any physical object (tangible item) that is typically produced by a manufacturer so as to satisfy and meet the demands, needs or wants of every customer. Some examples of a product include the following:

  • Mobile phones
  • Television
  • Microwave oven
  • Laptop

In conclusion, we can infer and logically deduce that it is not all products or services that are well-suited for sale on the Internet through e-commerce.

Read more on e-commerce here: brainly.com/question/23369154

#SPJ1

4 0
2 years ago
In Microsoft Excel, repeated hashes (#####) imply which of the following?
shtirl [24]

.......................................................

3 0
2 years ago
The directory partition holds configuration information that can affect the entire forest, such as details on how domain control
Levart [38]

Answer: True

Explanation:

A directory partition is a partition that contains active directory objects, which is part of the forest's Domain Name System (DNS) namespace, and is replicated among domain controllers (DCs).

It is a contiguous portion of the overall directory that has independent replication scope and scheduling data. A directory partition is also known as naming context.

4 0
3 years ago
Other questions:
  • An iPad Is An Example Of Which Type Of Computer?
    11·2 answers
  • On laptops with a smart card reader installed, where is the smart card reader usually located?
    13·1 answer
  • Which of the following is not an element of the modified block style?
    7·2 answers
  • 2) What are two reasons we analyze algorithms?
    7·2 answers
  • You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful subnet mask would you use?A. 255.25
    12·1 answer
  • Which type of boot authentciation is more secure?
    10·1 answer
  • Which element is represented by the electron configuration in example B? Example B: 1s22s22p63s23p64s1 Aluminum Cesium Potassium
    12·2 answers
  • Consider the following statement: String myMiddleInitial = “h”;
    15·1 answer
  • Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
    11·1 answer
  • For a web application we associate a web server, for a mobile application we associate a mobile server. for a decentralized appl
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!