Category: 

What Are OpenGL® Coordinates?

Article Details
  • Written By: G. Wiesen
  • Edited By: Shereen Skola
  • Last Modified Date: 01 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Built at the request of Dag Hammarskjöld, the United Nations Headquarters has a meditation room dedicated to silence.   more...

October 1 ,  1890 :  Yosemite National Park was established.  more...

OpenGL® coordinates are numerical values that indicate specific positions within a virtual, three-dimensional (3D) space. These values are individual points similar to those plotted on a graph in mathematical activities in arithmetic and algebra. Using this type of system, coordinates can be identified by three different values that indicate the position of that particular point in each of three directions. OpenGL® coordinates are usually indicated along a “Y-axis,” which is an up or down position; the “X-axis” that dictates the position of a point to the left or right of middle; and a “Z-axis” that indicates how close or far from a viewer the point is located.

The system used to designate the position for OpenGL® coordinates is quite similar to the one used to graph equations and values in mathematics. While those systems typically have two directions and values, an “X” and “Y” value, the system used in OpenGL® has a third value to determine where an object is in 3D space. These are used by a programmer to assign particular OpenGL® coordinates to different points, which can then be used to create objects in the program.

Ad

One simple way for someone to envision the use of OpenGL® coordinates is to consider a basic graph used in mathematics. This type of system has a horizontal line and a vertical line, or an X-axis and a Y-axis. A point at the intersection between these two is typically indicated by the coordinate (0, 0) with the first number representing the X-axis and the second indicating position on the Y-axis.

OpenGL® coordinates use a similar system and allow someone creating objects in the program to assign values to distances along those axes. Numerical values are then used to indicate the distance of a point from that central intersection of (0, 0). Negative values indicate left or down on the axes, while positive values represent positions to the right or up from the intersection. This means that a point at (1, 1) is one unit to the right of the central point and one unit up from it.

In addition to these two axes, OpenGL® coordinates also use a Z-axis, which represents the third dimension of space. Basically, this value controls how close or far a point is from the viewing position of the invisible camera within the space. This camera represents a viewer if he or she was within the virtual environment created using OpenGL®. A positive value on the Z-axis indicates an object that is closer to the camera than the intersection point, while a negative number is used for points that are further away.

The entire system of OpenGL® coordinates allows someone to indicate the precise location of a point within the virtual 3D space. Someone can, therefore, indicate one point at (1, 2, 3), which is an object one unit to the right, two units up, and three units toward a viewer from the central point. A second point can be created at (-1, 2, -1) that would be one unit to the left, two units up, and one unit away from the viewer from the central point. These two points can then be connected by a line that can exist within the 3D environment, with additional points and lines creating more complex shapes.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}