I'm working with Qt 4.8 and its OpenGL module, with the fixed pipeline and I have a sphere that was cubemapped, with the tex coords for each cube face auto-generated by OpenGL via
Code :
glTexGenf
(R, S and T coordinates), like this:

Code :
glEnableClientState(GL_NORMAL_ARRAY);
const GLenum textgt = GL_TEXTURE_CUBE_MAP;
const GLfloat param = GL_REFLECTION_MAP;
 
glTexGenf( GL_S, GL_TEXTURE_GEN_MODE, param );
GLenum error = glGetError();
if(GL_NO_ERROR != error) { ... }
 
glTexGenf( GL_T, GL_TEXTURE_GEN_MODE, param );
error = glGetError();
if(GL_NO_ERROR != error) { ... }
 
glTexGenf( GL_R, GL_TEXTURE_GEN_MODE, param );
error = glGetError();
if(GL_NO_ERROR != error) { ... }
 
glEnable( GL_TEXTURE_GEN_S );
glEnable( GL_TEXTURE_GEN_T );
glEnable( GL_TEXTURE_GEN_R );

When clicking in the scene, I'm retrieving the vertex coordinates under the mouse cursor via
Code :
glReadPixels
and
Code :
gluUnProject
.

What I'm looking for is a way to retrieve the texture coordinate associated to that position, instead of getting the vertex value.
I didn't find anything regarding this topic, so I was wondering if there was a way to achieve this.

Thanks for your time!