The vectors i,j,k can be determined as follows:
These vectors can then be used to form a change-of-basis matrix,
which is composed with a translation to yield the camera-to-world
transformation and its inverse, which is what we really desire.
gluLookAt(ex,ey,ez,rx,ry,rz,ux,uy,uz>
where (ex,ey,ez) gives the eye point,
(rx,ry,rz) gives the reference or 'lookat' point, and
(ux,uy,uz) gives the up vector.
This function call
postmultiplies the current matrix, so the easiest way to use it is:
glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(ex,ey,ez,rx,ry,rz,ux,uy,uz); /* setup modelling transformations here */