I have something that resembles this.
There is no error, yet all the variables remain zero'ed. Do I need to do anything else? The documentation/FAQ on this function is sparse.Code:case WM_LBUTTONDOWN: { GLdouble window_x = static_cast<double>( LOWORD(lParam) ); GLdouble window_y = static_cast<double>( HIWORD(lParam) ); GLdouble object_x = 0, object_y = 0, object_z = 0; GLdouble model_view[16] = { 0 }, projection[16] = { 0 }; GLint viewport[4] = { 0 }; glGetDoublev( GL_MODELVIEW_MATRIX, model_view ); glGetDoublev( GL_PROJECTION_MATRIX, projection ); glGetIntegerv( GL_VIEWPORT, viewport ); if( gluUnProject( window_x, window_y, 0, model_view, projection, viewport, &object_x, &object_y, &object_z ) == GL_FALSE ) dout << L"WTEGSDJSDKJLS!!\n"; dout << object_x << TEXT("\t") << object_y << TEXT("\t") << object_z << TEXT("\n"); break; }



LinkBack URL
About LinkBacks


