yes, i want to move the point on the screen plane, so for example i could render a cube on that point where my mouse is currently, by using 3d coordinates, and then i shoot a line from that position to the place where my mouse is pointing, so it would hit the triangle in my 3d world, and that how i could select that object with mouse.
sorry for being unclear :/
--
Edit: yay i got it working with that nehe tutorial! thanks, i didnt know it would be that easy!
This is the code im using now and it works great:
void GetOGLPos(int x, int y, GLdouble &posX, GLdouble &posY, GLdouble &posZ){
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 = (float)x;
winY = (float)viewport[3]-(float)y;
glReadPixels(x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ);
gluUnProject(winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
}