In an attempt to disable the trackball control rotate event and trigger a custom rotate event, I have encountered some challenges. While setting controls.enableRotate = false; works for OrbitControl, it does not completely disable the trackball control rotate functionality. The issue can be observed in this fiddle: https://jsfiddle.net/azso936f/1/ In the fiddle, the rotation operation occurs on mousemove, but when mousedown is triggered, the rotation functionality of the trackball control also kicks in.
var scene, renderer, camera;
var cube;
var controls;
var containerWidth = window.innerWidth,
containerHeight = window.innerHeight;
var isDragging = false;
var previousMousePosition = {
x: 0,
y: 0
};
init();
animate();
function init() {
configureRenderer();
scene = new THREE.Scene();
configureCube();
configureCamera();
configureLight();
configureControls();
}
function configureRenderer() {
// Renderer configuration code
}
function configureCube() {
// Cube configuration code
}
function configureCamera() {
// Camera configuration code
}
function configureLight() {
// Light configuration code
}
function configureControls() {
// Controls configuration code
}
function animate() {
// Animation code
}