Are you including your matrix changes into gluUnProject? If you pass gluUnproject the modelview matrix that goes from world to camera space, you’re fine if you don’t rotate the object. However, if you do rotate the object via the modelview matrix, gluUnproject has to use that new matrix.

Imagine this was the matrix setup:

ViewportMatrix * ProjectionMatrix * ModelViewMatrix * Vertex = VertexOnScreen

Going in modelview details:

ViewportMatrix * ProjectionMatrix * (gluLookAt matrix) * Vertex = VertexOnScreen

If you’re rotating the mesh,

ViewportMatrix * ProjectionMatrix * (gluLookAt matrix * someRotationMatrix) * Vertex = VertexOnScreen

To go the other way around, gluLookAt obviously needs to know about the rotation. Are you sure it is getting the new modelview matrix from the rotation?