Hi,
I modified your program to use AWT since Newt is lagging on my macOS. I needed to fix something on the AWT mouse controller so I pushed the updated sources and just deployed the jar (2.1.1-SNAPSHOT), which should let you run my modifications without trouble.
I got something a bit better by changing the Z value of the screen coordinates. Using value 1 instead of 0 let me move the green sphere correctly, however
- jitter appears after moving other spheres
- sometime the sphere is not exactly under mouse (while sometime it is)
I modified the sample to show you how to define this Z value by yourself. To choose how to configure it, gluUnProject documentation may help. It should be between 0 and 1, 0 being the near clipping plane of the camera, 1 being the far clipping plane. I tried to get the "screen Z value" of the picked sphere to set it but it did not help. Here's what the doc says
You did a couple of things right
- Not squaring the scene to avoid transforms that may lead to erroneous projection
- Disabling HiDPI to avoid multiplying mouse coordinates with pixel ratio
So for now I don't have other ideas to help you. Let me know if you find a solution, I'll tell you if I get something better.
Martin