Next: (Typically) Projection Transformations:
Up: OpenGL Quick Reference Guide
Previous: Transformations and Perspective:
(Typically) Modelview Transformations
These are typically applied in modelview mode. They are useful
for positioning objects to make them easier to draw. The following
procedures generate a transformation matrix for the given task and then
compose with the current transforamation matrix. They are composed so
that the most recently composed transformation is applied first to the
object vertices. Except for gluLookAt(), they all have two forms,
either ending in "d" (for double arguments) or "f" (for
float arguments). Only the floating forms are given here.
- gluLookAt(eyex, eyey, eyez, centerx, centery, centerz,
upx, upy, upz):
-
All arguments are of type double. This generates a
transformation which maps world coordinates into camera
coordinates. This is typically called before any drawing is
done (just after glLoadIdentity()). The camera position
is specified by the eye location, looking at the given center
point, with the given up-directional vector. It composes this
with the current (typically modelview) transformation.
- glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z):
-
Generate a rotation transformation about the specified vector
(x,y,z) and compose it with the current transformation.
- glScalef(GLfloat x, GLfloat y, GLfloat z):
-
Generate a scaling transformation and compose it with the current
transformation.
- glTranslatef(GLfloat x, GLfloat y, GLfloat z):
-
Generate a translation by vector (x,y,z) and compose it with
the current transformation.
Please report any errors or send comments to
Dave Mount
Last updated: Sat, Feb 8, 2003.