What does gluLookAt do (what matrix operations are performed)?

I have a general understanding about the function of gluLookAt. However, as i try to write my own version of it (as i understand it’s simply a matter of a number of matrix operations such as translation and rotation) i get stuck. So, here’s the question.

Suppose we wish to perform the following:

gluLookAt (xf,yf,zf,   xt,yt,zt,   xu,yu,zu)

but for some reason we can’t enter it :o !

What translations and rotations should we perform in order to obtain the same effect as the “forbidden” line above would give us? I have almost no idea on how to approach this one and since i’ve been studying mathematics for a few years now, i feel rather stupid. It should be some simple linear algebra, yet i get stuck like this.

http://www.cs.kuleuven.ac.be/cwis/research/graphics/INFOTEC/viewing-in-3d/node8.html
I think this would be helpful :stuck_out_tongue:

The manual page explains how it’s constructed
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/lookat.html
I would have to check my linear algebra books to be sure, but I think it’s easier to view this as a generalized axis/reference transformation (don’t know if this is the correct english term) than as a concatenation of affine transformations.