As shown in the picture my object has its own "local coordinate system".(Actually I have a pointcloud instead of a mesh)
Then I apply transformations/scaling..etc to ModelView matrix and transformed coordinate system is "modelview coordinate system".
Now I am tring to pick of "vertex" using gluUnproject as follows.
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY, winZ;
glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
glGetDoublev(GL_PROJECTION_MATRIX, projection);
glGetIntegerv(GL_VIEWPORT, viewport);
winX = (GLfloat) mousePosition.x();
winY = (GLfloat) viewport[3] - (float) mousePosition.y();
glReadPixels((int)winX , int(winY) , 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT,&winZ);
GLdouble posX, posY, posZ;
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
Does this "gluUnProject" should give me the location relative to the "local coordinate system" or is it relative to the "modelview coordinate system" ?