23.06.2013 Views

The OpenGL Graphics System: A Specification

The OpenGL Graphics System: A Specification

The OpenGL Graphics System: A Specification

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.7. VERTEX SPECIFICATION 20<br />

Pointer, IndexPointer, NormalPointer, TexCoordPointer, SecondaryColor-<br />

Pointer, VertexPointer, VertexAttribPointer, ClientActiveTexture, InterleavedArrays,<br />

and PixelStore is not allowed within any Begin/End pair, but an<br />

error may or may not be generated if such execution occurs. If an error is not generated,<br />

GL operation is undefined. (<strong>The</strong>se commands are described in sections 2.8,<br />

3.6.1, and chapter 6.)<br />

2.7 Vertex <strong>Specification</strong><br />

Vertices are specified by giving their coordinates in two, three, or four dimensions.<br />

This is done using one of several versions of the Vertex command:<br />

void Vertex{234}{sifd}( T coords );<br />

void Vertex{234}{sifd}v( T coords );<br />

A call to any Vertex command specifies four coordinates: x, y, z, and w. <strong>The</strong><br />

x coordinate is the first coordinate, y is second, z is third, and w is fourth. A<br />

call to Vertex2 sets the x and y coordinates; the z coordinate is implicitly set to<br />

zero and the w coordinate to one. Vertex3 sets x, y, and z to the provided values<br />

and w to one. Vertex4 sets all four coordinates, allowing the specification of an<br />

arbitrary point in projective three-space. Invoking a Vertex command outside of a<br />

Begin/End pair results in undefined behavior.<br />

Current values are used in associating auxiliary data with a vertex as described<br />

in section 2.6. A current value may be changed at any time by issuing an appropriate<br />

command. <strong>The</strong> commands<br />

void TexCoord{1234}{sifd}( T coords );<br />

void TexCoord{1234}{sifd}v( T coords );<br />

specify the current homogeneous texture coordinates, named s, t, r, and q. <strong>The</strong><br />

TexCoord1 family of commands set the s coordinate to the provided single argument<br />

while setting t and r to 0 and q to 1. Similarly, TexCoord2 sets s and t to the<br />

specified values, r to 0 and q to 1; TexCoord3 sets s, t, and r, with q set to 1, and<br />

TexCoord4 sets all four texture coordinates.<br />

Implementations must support at least two sets of texture coordinates. <strong>The</strong><br />

commands<br />

void MultiTexCoord{1234}{sifd}(enum texture,T coords)<br />

void MultiTexCoord{1234}{sifd}v(enum texture,T<br />

coords)<br />

Version 2.0 - October 22, 2004

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!