OrbitControls custom panning

in this example As you can see when you left click you can move the camera in a straight line,
I want to change how the camera moves to the right or left
I mean,
When I left click and move the mouse up or down, the camera moves back and forth, right? And when I move to the right or left, it moves in a straight line to the right or left, now I want the movement to the right or left to be circular, that is, the camera rotates.
What part of OrbitControls.js should I change?

Doesn’t anyone have any suggestions for solving this problem?

@Teymoor –

OrbitControls (and its derivative MapControls) allow to reassign roles of buttons. However, I doubt that it can mix roles – horizontal motion to rotate, vertical motion to zoom.

If you want to change OrbitControls.js, you first have to study how it works.

A much faster approach is to write your own simple rotation/zooming the way you need it – it would be around only 20 lines of code.

– Pavel

1 Like