I think that the best (fastest) method to pick up an object in OpenGL environment depends a lot on the types of objects you use.
For many years I used the GL_SELECTION render mode, but later, as my application was very particular with the type of objects used, I changed the way to pick up these objects, and now it is done with my own code.
The above suggestions are great. Here is a quick example that I put together which interacts with the Xojo pixel position and moves the circle in the OpenGLSurface control.
Press the button ShowOpenGL Surface to show the control and then click and drag your mouse on the blue circle. The additional step of a button is needed as there is a small bug in Xojo at the moment.
I think what I really need to do is simply translate the XYZ of any given vector to screen coordinates.
Then I’ll loop through the closest to furthest from the camera, and stop if I find find one that is within a reasonable buffer for a mouse click.
I’ve been trying to find an example of how to do this, but I’m lost in the noise.
I think Ramon’s suggestion might include the closest means to do this, but it seems like it’s not quite what I’m looking for (I could be wrong).
Once I have a camera position, and quaternions etc all stacking up to create the scene pre-rendering, I’m not sure how to untangle to figure out how the point’s XYZ relate to the screen world.