Hey folks,
I have encountered a bug when using PointerDragBehavior with the default axis (camera view ray aligned). The mesh being dragged drifts towards the camera.
This can be observed in the following playground by dragging the sphere towards the edges / corners of the screen – the drifting effect is stronger the further out of view center the mesh is being dragged.
Seems almost like it could be an unexpected effect of perspective camera and distance calculation?
1 Like
There is indeed a strange issue here.
After a few tests, I can notice that it depends even more on the point where you drag the mesh. There must me a ray tracing problem here (mesh being moved depending on a picked point, and then there is a closed loop)
Try this, and within one move only, the sphere reaches camera
1 Like
I’ve created a PR with a way to fix this:
Here’s a PG with the change monkey patched in to show working (sorry, I am not very comfortable with the PR sandbox process yet and don’t have much time):
It just makes sure the drag plane is a true plane, e.g. parallel to the camera’s view plane / perpendicular to its view ray. Perspective effect was causing a convergence artifact because the ray was being cast from the drag point to the camera position rather than to the view plane.
At least that’s what I understand!