Hum…giving that you are suppling gluLookAt with the points in which to look at.
With a little vector math you should be able to get the camera rotation.
Using the first two points in the gluLookAt, you should be able to come up with angle of rotation.
the other option would be to not use gluLookAt, since it is equal to doing something like the following:
glTranslatef(x2,y2,z2); // look at
glRotate( angle_x, 1.0, 0.0, 0.0);
glRotate( angle_y, 0.0, 1.0, 0.0);
glRotate( angle_z, 0.0, 0.0, 1.0);
glTranslatef(x1,y1,z1); // eye point
// Note bound to be a error here, doing it all in my head… but it should give you an idea.
This way you know the angles of rotation supplied vs. maybe having to convert the gluLookAt points to angles.
Or if you want to keep using glLookAt, it maybe easier to conver angles to the points needed in the gluLookAt, I did a post on this some time back using sin/cos to give rotated points for gluLookAt. I don’t have my notes handy on it.
Originally posted by Structural:
[b]
OK, How would I do this? I don’t know my cams rotation since I use GLULOOKAT.
I know how I can get the current view matrix (glGetFloatv(GL_MODELVIEW_MATRIX, array)) but which values in that matrix are the rotation (or how would I get them)?
MadMan, I read something about billboarding in the gamedev book, but it seems to lack a decent snippet (or anything that I can understand)
[This message has been edited by Structural (edited 12-02-2002).][/b]
[This message has been edited by nexusone (edited 12-02-2002).]