I have an Orthographic camera where the position is { x:0, y:100, z:0 }
and is pointing/looking at { x:0, y:0, z:0 }
. At this point, I'm able to capture the mouse movement and translate it to make the pan correctly. If the mouse goes 10 px down/y I just have to move Z in the 3D world.
The problem is that I don't know how to calculate if the camera position is in perspective, let's say:
position: { x:50, y:50, z:50 }
lookAt: { x:0, y:0, z:0 }
I guess I have to use some trigonometry, but I'm very lost, to be honest. Any guide would be very helpful.