glVertex
| Definition: |
include pGUI.e
include opengl.e glVertex(atom x, y, z=0, w=1) -- or -- glVertex3d(atom {x,y,z}) (actually declared as a single sequence parameter) |
| Description: |
Deprecated, specifically not supported on WebGL. While still supported on desktop/Phix, these routines have been coloured illegal to indicate they cannot be handled by pwa/p2js. Specifies a vertex. x: Specifies the x-coordinate of a vertex. y: Specifies the y-coordinate of a vertex. z: Specifies the z-coordinate of a vertex. w: Specifies the w-coordinate of a vertex. |
| pwa/p2js: | Not supported. |
| Remarks |
The glVertex() procedures are used within
glBegin/glEnd() pairs to
specify point, line, and polygon vertices. The current color, normal, and texture coordinates are associated with the vertex when glVertex is called. When only x and y are specified, z defaults to 0.0 and w defaults to 1.0. When x, y, and z are specified, w defaults to 1.0. Invoking glVertex() outside of a glBegin/glEnd() pair results in undefined behavior. A vertex with w == 1.0 stays in place whereas w == 0.0 moves it to infinity. The following may (or may not) help: glLoadIdentity() glTranslatef(a, b, c) glVertex(x, y, z) -- |1 0 0 a| |x| |x+a| -- |0 1 0 b| |y| |y+b| -- |0 0 1 c| * |z| = |z+c| -- |0 0 0 1| |1| |1| glLoadIdentity() glTranslatef(a, b, c) glVertex(x, y, z, 3) -- |1 0 0 a| |x| |x+3a| -- |0 1 0 b| |y| |y+3b| -- |0 0 1 c| * |z| = |z+3c| -- |0 0 0 1| |3| |3| There are 24 C functions (see index, coloured illegal and linked here) named glVertexNx[v], where N is 2..4, x is d/f/i/s for double/float/integer/short, and the v if present indicates the parameter is a pointer to the first of such (only useful if there was some good reason why you already had your double/float/integer/short values poked into some allocated memory, let me know if you find such a need). The optional parameters and generic atom types of Phix mean these can and should all be wrapped into a single pGUI function. The glVertex3d routine was made an exception because some code already had the required parameters in a sequence, and it would be pointless to de-sequence that only to re-sequence it shortly after. |
| See Also: |
glBegin,
glCallList,
glColor,
xor_bits,
glEnd,
xor_bits,
xor_bits,
glLoadIdentity,
xor_bits,
glNormal,
xor_bits,
glTexCoord
DEV See also //glBegin //glCallList //glColor glEdgeFlag //glEnd glEvalCoord glIndex //glLoadIdentity glMaterial //glNormal glRect //glTexCoord |