What are primitives in OpenGL?
The term Primitive in OpenGL is used to refer to two similar but separate concepts. The first meaning of “Primitive” refers to the interpretation scheme used by OpenGL to determine what a stream of vertices represents when being rendered e.g. “GL_POINTS”. Such sequences of vertices can be arbitrarily long.
How many OpenGL primitives are there in the OpenGL API?
OpenGL provides ten different primitive types for drawing points, lines, and polygons, as shown in Figure 2-1. Figure 2-1 OpenGL primitive types. OpenGL interprets the vertices and renders each primitive using the following rules: GL_POINTS— Use this primitive type to render mathematical points.
What are the different types of triangle primitives?
There are 3 kinds of triangle primitives, based again on different interpretations of the vertex stream: GL_TRIANGLES: Vertices 0, 1, and 2 form a triangle. Vertices 3, 4, and 5 form a triangle. And so on.
What are the basic geometrical primitives of OpenGL?
First, let me mention that OpenGL is a low level API, this means that it has no support for drawing complex geometrical objects. It is the programmer’s job to combine the geometrical primitives from OpenGL in complex shapes and bodies. The basic geometrical primitives that the core OpenGL profile provide to us are points, lines and triangles.
How many vertices does a triangle have in OpenGL?
From a geometrical point of view, a triangle is completely defined by the position in space of his three corners or vertices. In OpenGL terminology, a vertex can be seen as a collection of attributes like position, color, texture coordinates etc … In the above figure we have four triangles and twelve vertices.
Which is the next step in the OpenGL pipeline?
It is the programmer’s responsibility to write a vertex shader for every OpenGL based application. The next step, in our simplified model of the OpenGL pipeline, is the Primitive Setup stage that will organize the vertices into geometric primitives (points, lines and triangles) for the next two stages.