OrbitControls Pan

I use Orbit Controls without rotation.

const controls = new OrbitControls(camera, renderer.domElement);
controls.enableRotate = false;
controls.update();

I need only pan functionality but in a slightly different way. Pan an x ​​and y axis instead of z axis.
I use link below for importing orbit controls.

import { OrbitControls } from ‘https://cdn.jsdelivr.net/npm/three@0.117.0/examples/jsm/controls/OrbitControls.js’;

controls.screenSpacePanning = true;

I found a solution . Maybe help someone.

2 Likes