import { TrackballControls } from 'three/examples/jsm/controls/TrackballControls'
const cameraControls = new TrackballControls(camera, renderer.domElement)
function renderScene() {
// ...
cameraControls.update()
// ...
renderer.render(scene, camera)
requestAnimationFrame(renderScene)
}