When I move the camera by changing its x and y, everything works correctly, but when I create OrbitControls after moving, the camera is moved to zero position, and the values of x and y previously set start to work as rotation. How do I turn this behavior off?
Can you please demonstrate with a live example the what you mean with “the camera is moved to zero position”?
Hi @Mugen87 . As you can see in this example, the camera moves along the x and y axes while the left mouse button is pressed. But if you turn on the controls, the camera’s behavior will change completely, and even if you turn off the controls as null, the camera’s behavior will remain the same. The main purpose is to use the built-in zoom in OrbitControls together with the custom mouse movement.
Maybe like so: https://jsfiddle.net/m2x7b8d3/
The idea is to disable orbiting and panning as well as to update
OrbitControls.target (which is nothing else than the focus point) when the camera is translated.