I am getting wrong values when calling glReadPixels
问题 In my program I am trying to select an object on right mouse click event using glReadPixels method. Window for rendering is created using wxWidgets (by extending wxFrame and wxGLCanvas). However, I am getting wrong values. He is tutorial that I used I was suggested to use this approach as it seems faster and easier than ray casting. My code: #include "MyGLCanvas.h" #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> BEGIN_EVENT_TABLE(MyGLCanvas,