Category: 

What Is an OpenGL® Projection?

Article Details
  • Written By: Eugene P.
  • Edited By: Angela B.
  • Last Modified Date: 17 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The mongoose was introduced to Hawaii in order to kill rats, but mongooses hunt in the day, while rats are nocturnal.  more...

December 7 ,  1941 :  Japanese bombers attack Pearl Harbor.  more...

An OpenGL® projection is the process and image resulting from the translation of three-dimensional (3D) objects to an aligned two-dimensional (2D) image that can be displayed on a screen. The word "projection" in computer graphics programming refers to the fact that 3D objects within a scene need to be mathematically moved, or projected, onto a virtual 2D surface so it can be shown on a flat display on a device. Although the entire sequence of events that take a 3D object and render it to a 2D surface can be called projection, the term also is more narrowly applied to the specific set of geometric transformations in the graphics pipeline that occurs as a step between other sets of transformations. The two specific types of OpenGL® projection modes that are available to programmers are perspective and orthographic.

Ad

The challenge of creating an OpenGL® projection is to take the data that comprise all the objects in a given scene and adjust it so that, when shown on a screen, the objects are consistent with the projection mode, viewing volume and virtual camera settings. The viewing volume is the visible area of a scene from the location of the viewer within the scene, or the eye position. Six numbers define the viewing volume, including the right, left, top and bottom distances from a virtual center of the viewing frame. Additionally, two values known as the near and far planes define the depth of the viewing volume. This volume defines what objects will be projected, while all other objects outside the volume will be ignored, or clipped so the non-visible portions are not evaluated.

The first mode of OpenGL® projection that can be employed is known as orthographic projection. In this mode, the coordinates of the objects within a scene are not adjusted for their distance from the viewer, or perspective. This means all objects are drawn in the same size no matter the distance from the viewer. This OpenGL® projection mode is most often used in 3D modeling programs, engineering design programs and applications that use 3D polygons to create 2D composite images and do not require accurate perspective.

The more commonly used OpenGL® projection mode is known as perspective projection. In perspective projection mode, the objects in a scene are scaled and positioned according to their distance from the viewer. This means objects that are more distant appear smaller. It also means that objects in the scene are adjusted so they slowly converge at a point on the viewing horizon known as the vanishing point. Perspective projection closely models how the real world appears and is used to create realistic renderings as opposed to technical ones.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email