Vertex (computer graphics)
Encyclopedia
A vertex in computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....

 is a data structure that describes a point in 2D or 3D space
Space
Space is the boundless, three-dimensional extent in which objects and events occur and have relative position and direction. Physical space is often conceived in three linear dimensions, although modern physicists usually consider it, with time, to be part of a boundless four-dimensional continuum...

. Display objects are composed of arrays of flat surfaces (typically triangles) and vertices define the location and other attributes of the corners of the surfaces.

Application to object models

In computer graphics, objects are most-often represented as triangulated polyhedra
Polyhedron
In elementary geometry a polyhedron is a geometric solid in three dimensions with flat faces and straight edges...

. Non triangular surfaces can be converted to an array of triangles through tessellation
Tessellation
A tessellation or tiling of the plane is a pattern of plane figures that fills the plane with no overlaps and no gaps. One may also speak of tessellations of parts of the plane or of other surfaces. Generalizations to higher dimensions are also possible. Tessellations frequently appeared in the art...

. The vertices of triangles are associated not only with position but also with other graphical attributes used to render
Render
Render or rendering may refer to:In Computing:* Artistic rendering, creating, shading and texturing of an image* Architectural rendering, creating two-dimensional images or animations showing the attributes of a proposed architectural design...

 the object correctly. Such attributes can include color at the vertex point, reflectance of the surface at the vertex, textures of the surface at the vertex, and the normal of an approximated curved surface at the location of the vertex. These properties are used in rendering by a vertex shader or vertex pipeline
Vertex pipeline
The function of the vertex pipeline in any GPU is to take geometry data , work with it if needed with either fixed function processes , or a vertex shader program , and create all of the 3D data points in a scene to a 2D plane for display on a computer monitor.It is possible to eliminate unneeded...

.

The normal can be used to determine a surface's orientation toward a light source for flat shading using Lambert's cosine law
Lambert's cosine law
In optics, Lambert's cosine law says that the radiant intensity observed from a Lambertian surface or a Lambertian radiator is directly proportional to the cosine of the angle θ between the observer's line of sight and the surface normal. A Lambertian surface is also known as an ideal diffusely...

, or the orientation of each of the vertices to mimic a curved surface with Phong shading
Phong shading
Phong shading refers to an interpolation technique for surface shading in 3D computer graphics. It is also called Phong interpolation or normal-vector interpolation shading. Specifically, it interpolates surface normals across rasterized polygons and computes pixel colors based on the interpolated...

.

Vertex attributes

Most attributes of a vertex represent vectors in the space to be rendered
Rendering (computer graphics)
Rendering is the process of generating an image from a model , by means of computer programs. A scene file contains objects in a strictly defined language or data structure; it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene...

. Vectors can be 1 (x), 2 (x, y), or 3 (x, y, z) dimensional and can include a fourth homogeneous coordinate
Homogeneous coordinates
In mathematics, homogeneous coordinates, introduced by August Ferdinand Möbius in his 1827 work Der barycentrische Calcül, are a system of coordinates used in projective geometry much as Cartesian coordinates are used in Euclidean geometry. They have the advantage that the coordinates of points,...

 (w).

The following is a table of built in attributes of vertices in the OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

standard.
OpenGL vertex attributes
GL attribute name attribute defined (data value size)
gl_Vertex Position (vec4)
gl_Normal Normal (vec4)
gl_Color Primary color of vertex (vec4)
gl_MultiTexCoord0 Texture coordinate of texture unit 0 (vec4)
gl_MultiTexCoord1 Texture coordinate of texture unit 1 (vec4)
gl_MultiTexCoord2 Texture coordinate of texture unit 2 (vec4)
gl_MultiTexCoord3 Texture coordinate of texture unit 3 (vec4)
gl_MultiTexCoord4 Texture coordinate of texture unit 4 (vec4)
gl_MultiTexCoord5 Texture coordinate of texture unit 5 (vec4)
gl_MultiTexCoord6 Texture coordinate of texture unit 6 (vec4)
gl_MultiTexCoord7 Texture coordinate of texture unit 7 (vec4)
gl_FogCoord Fog Coord (float)
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK