What Is OpenGL® Programming?

G. Wiesen

OpenGL® programming is a process by which someone creates Computer-Generated Imagery (CGI) through code rather than through a program that features a graphical toolset. This process often involves the creation of code that executes a number of different processes, which in turn is used by software to display images. Someone can use OpenGL® programming to create two-dimensional (2D) images or three-dimensional (3D) images, both of which are often used in video games. The creation of CGI through these programs frequently involves the use of a number of programming methods and a great deal of code to indicate how objects should appear and act within an environment.

OpenGL is an open source standard and abstract programming interface (API) for programming three-dimensional (3D) graphics in computer programs.
OpenGL is an open source standard and abstract programming interface (API) for programming three-dimensional (3D) graphics in computer programs.

Different elements in CGI or computer-generated imagery can be created through the use of OpenGL® programming. This process often begins with the creation of a design document or other work that allows a programmer to fully understand what he or she needs to create in OpenGL®. At this point, the programmer can begin to plan out the process of OpenGL® programming that he or she needs to use to create the objects and effects used within the scene. Computer code is then created by that programmer, which is used by software to render out the different elements of a CGI scene.

Both 2D or two-dimensional and 3D or three-dimensional objects and scenes can be created through OpenGL® programming, depending on the approach a programmer takes. In its simplest form, a person can use code to indicate where points in space should be located, utilizing the axes that are often used for plotting graphs in mathematics. These individual points established in OpenGL® programming are called vertices. Each one can be connected to other points by lines, which can then create different shapes, and these shapes can create 2D images or be connected together to form the surface of a 3D object.

Additional OpenGL® programming is then used to establish different types of textures that can be applied to the objects within a scene. These textures are 2D images that are basically wrapped around the 3D objects, a process called texture mapping, making the objects appear more realistic and giving them more variation. OpenGL® programming is used for all of these processes, in addition to the creation and assignment of lights in a scene as well as effects like fog, fire, and water. The benefit of using this type of approach is that the objects created through such programming can be easily recognized and replicated by numerous computer systems, allowing software to run on different hardware setups more simply.

You might also Like

Discuss this Article

Post your comments
Forgot password?