At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.
"OpenGL® drawing" is a general term that can be used to indicate an application has been set to use Open Graphics Library® libraries to render to the display. It also can be used in programming to describe the use of the different functions within a library to create the elements in a scene. Most often, OpenGL® drawing involves assembling points and lines into triangles, quadrilaterals or other polygons to create discernable objects or interfaces that a user can see or interact with. An OpenGL® drawing also can be the final rendered scene as it is displayed on a screen or other device.
From a programming perspective, OpenGL® drawing is very similar to drawing on paper with a pen. There is a type of virtual stylus within OpenGL® that can be moved from one position to the next but always remembers exactly where it is currently located. The stylus can be moved and reset but, at the same time, it can be used to outline continuous sets of points.
One example of using the position marker for drawing is an object called a triangle strip. This is a sequence of triangles in which each one shares a side with the next triangle. Using OpenGL® drawing functions, a point is drawn, followed by two more to create a basic triangle. The next two points to which the virtual stylus is moved will be connected, forming a second triangle. This process can be used to draw entire elaborate objects by moving from point to point.
Through the use of utility libraries or extensions, there are a number of high-level OpenGL® drawing functions that can be used to help simplify the construction of complex scenes. These functions can draw a cube, sphere or other shape primitive, removing the need to laboriously generate boilerplate code to draw the shape. Points, which are just single dots at a given location, can be manipulated through the drawing functions so a raster image such as a photograph can be translated into three-dimensional (3D) coordinates.
After the geometry for a scene has been determined and passed to the graphics hardware, OpenGL® drawing routines assist in rendering the scene to a display device. When the mathematical information that describes the points, lines and surfaces of a scene are drawn to a monitor, the process is known as rasterization, in which the image is made two-dimensional (2D) so it can be shown. The resulting 2D rasterized image made from the 3D data can be called an OpenGL® drawing.