Legacy (immediate mode)GL 1.0

glVertex3f

Emits one vertex position inside a glBegin/glEnd block.

Part of the family glVertex*

Removed from the core profile. Part of the legacy immediate mode, removed from the core profile in OpenGL 3.2. Shown here only so you can recognize it in old tutorials — use VBOs and VAOs instead.

Signature

void glVertex3f(GLfloat x, GLfloat y, GLfloat z);

How it works

The vertex takes whatever color, normal and texture coordinate were set last. Today the positions go into a vertex buffer and are described with glVertexAttribPointer.

Parameters

xGLfloat

X coordinate.

yGLfloat

Y coordinate.

zGLfloat

Z coordinate.

Example

example.cpp
1glVertex3f(0.0f, 0.5f, 0.0f);