.
.
.
GLdouble *mmatrix = 0;
GLdouble *pmmatrix = 0;
GLint *vport = 0;
GLdouble *rx0 = 0;
GLdouble *rx1 = 0;
GLdouble *ry0 = 0;
GLdouble *ry1 = 0;
GLdouble *rz0 = 0;
GLdouble *rz1 = 0;
GLfloat fx0 = 0;
GLfloat fy0 = 0;
GLfloat fz0 = 0;
glGetDoublev(GL_MODELVIEW_MATRIX, mmatrix);
glGetDoublev(GL_PROJECTION_MATRIX, pmatrix);
glGetIntegerv(GL_VIEWPORT, vport);
gluUnProject(ixo, iyo, 0, mmatrix, pmatrix, vport, rx0, ry0, rz0);
gluUnProject(ixo, iyo, 1, mmatrix, pmatrix, vport, rx1, ry1, rz1);
fx0 = *rx1 - *rx0;
fy0 = *ry1 - *ry0;
fz0 = *rz1 - *rz0;
glPushMatrix();
glTranslatef(fscale*xtranso, fscale*ytranso, 0.0);
glTranslatef(fscale*fxtrans, fscale*fytrans, 0.0);
glTranslate(-fx0, -fy0, -fz0);
glRotatef(ixrotate,1.0,0.0,0.0);
glRotatef(iyrotate,0.0,1.0,0.0);
glTranslatef(fx0, fy0, fz0);
.
.
.