In a basic glscene scene, I noticed an issue with the GetPickedObject function.
This function doesn't always return an object, even though visually it's clear that the user has clicked on it.
My scene contains a camera (CameraStyle=csPerspective), 1 dummyCube, and 2 spheres (Pickable=True).
In the attached image, the red dots represent the positions of the mouse clicks for which GetPickedObject returns nil.
I'm using GetPickedObject without issues with:
v2025.3 (SHA-1 70d1ef46696949214c615048358a3ad4916d3266 of 19 Sep 2025),
but I use it ONLY with TGLFreeForm objects (actually they are filled with STL files).
Check the video ( https://youtu.be/ASK4yTvK_hE ) where with CTLR + SHIFT and LEFT mouse button I can select a TGLFreeForm, draw a red container box, and select it in list of geometries (STL files).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
In a basic glscene scene, I noticed an issue with the GetPickedObject function.
This function doesn't always return an object, even though visually it's clear that the user has clicked on it.
My scene contains a camera (CameraStyle=csPerspective), 1 dummyCube, and 2 spheres (Pickable=True).
In the attached image, the red dots represent the positions of the mouse clicks for which GetPickedObject returns nil.
Thanks for your advices
In the past I've used the function and it worked for me to catch a TGLFreeForm:
Hi ShineWorld,
Thanks for your answer.
Unfortunately, that's the same method I was using, and it was causing the problem mentioned above.
I'm using GetPickedObject without issues with:
v2025.3 (SHA-1 70d1ef46696949214c615048358a3ad4916d3266 of 19 Sep 2025),
but I use it ONLY with TGLFreeForm objects (actually they are filled with STL files).
Check the video ( https://youtu.be/ASK4yTvK_hE ) where with CTLR + SHIFT and LEFT mouse button I can select a TGLFreeForm, draw a red container box, and select it in list of geometries (STL files).