MFC with Opengl get 3d coordinate from 2d coordinate of mouse
问题 I am using this code from NEHE tutorial in my MFC based application on mouseclick void CRightOGL::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default GLint viewport[4]; GLdouble modelview[16]={0}; GLdouble projection[16]; GLfloat winX, winY, winZ; GLdouble posX, posY, posZ; GLfloat mv[16]; glGetFloatv( GL_MODELVIEW_MATRIX, mv ); glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); glGetDoublev( GL_PROJECTION_MATRIX, projection ); glGetIntegerv