CG List of Functions
CG List of Functions
window as needing to
be redrawn. Causes
soon. Used in
animation loops or
Sets up a 2D
orthographic
projection matrix
(GLdouble left, GLdouble
gluOrtho2D(0.0, 300.0, defining a clipping
gluOrtho2D right, GLdouble bottom,
0.0, 300.0); volume where z is
GLdouble top)
between -1 and 1.
Useful for 2D
rendering.
identity matrix,
transformations. Used
transforms.
Defines a perspective
projections.
Sets a perspective
clipping planes.
rectangle in window
resize.
Enables server-side
correct 3D rendering.
Begins specifying
(GLenum mode) (e.g.,
vertices for a
glBegin GL_TRIANGLES, GL_QUADS, glBegin(GL_QUADS);
primitive. Must be
GL_POLYGON)
paired with glEnd().
Ends vertex
by glBegin().
Specifies a vertex
pointers to arrays.
Sets the current
(GLfloat red, GLfloat drawing color.
glColor3f /
green, GLfloat blue) or glColor3fv(colors[a]); Variants accept floats
glColor3fv
pointer to array or pointers to float
arrays.
Applies a translation
objects in 3D space.
Applies a rotation
transformation by
(GLfloat angle, GLfloat x, glRotatef(theta[axis],
glRotatef angle degrees about
GLfloat y, GLfloat z) 1.0, 0.0, 0.0);
the axis (x,y,z) to
callback function
window needs
redrawing.
resize events.
Registers the idle
callback function
updates.
Registers the
void (*func)(unsigned char glutKeyboardFunc(keyboard
glutKeyboardFunc keyboard input
key, int x, int y) );
callback function.
back buffers in
double-buffered mode
glutSwapBuffers None glutSwapBuffers();
to display the
rendered frame
smoothly.