Hi guys,
I’m trying to pan in an ortho projection using a camera located perpendicular to the plane. I calculate the distance between the last position of the mouse and the new one every time the mouse is moving and I shift the camera to this delta distance.
It works but I want the scene be synchronized with the mouse pointer in that way they move together keeping the objects in the scene at the same distance to the mouse cursor where they were located when the panning started. But it’s not like that; the objects in the scene are shifted a little more than the mouse cursor.
If I multiply this delta distance by a factor say 0.004 it works better but I’m still having the problem. Can someone explain me how can I calculate this factor and why it’s needed?
Thanks,
PD: I unproject the mouse coordinates before calculate the delta distance.