I am currently working on panning the camera around my scene using the mouse. I have successfully implemented this feature using TrackballControls by click and dragging.
function init(){
camera = new THREE.PerspectiveCamera(45,window.innerWidth / window.innerHeight, 1, 1000);
camera.position.z = 500;
controls = new THREE.TrackballControls(camera);
controls.addEventListener('change', render);
}
function animate(){
requestAnimationFrame(animate);
controls.update();
}
Is there a way to achieve this without the need for clicking? I am looking for a similar solution to the panning on this site ...
I have also created a codepen showcasing my progress so far.
Thank you :)