I’ve had a similar problem for quite a while. Here I’ll describe rotation around an arbitrary point.
The trick is that you must move to the arbitrary point FIRST and then do the rotation. Like this:
gltranslatef(p.x,p.y,p.z);
glRotatef(ang.x,1,0,0);
glRotatef(ang.y,0,1,0);
glRotatef(ang.z,0,0,1);
gltranslatef(-p.x,-p.y,-p.z);
glGetfloatv(GL_MODELVIEW_MATRIX,@m1);
I’m to lazy to do my own matrix calculations, but I think that 3d cards will accelerate this soon. If it’s slower to read the matrix from the OpenGl pipeline please somebody correct me.
God luck.
Ajasja.
------------------