I've been developing a website that allows users to explore celestial objects in the sky using VRControls and focus on their favorites with Trackball controls, which are activated by clicking on the object. Check out a demo of the project here: https://jsfiddle.net/tushuhei/4f1Lum5n/6/
function smoothTransition (obj, target) {
var dummyCamera = camera.clone();
controls = new THREE.TrackballControls(dummyCamera);
controls.target.set(obj.point.x, obj.point.y, obj.point.z);
new TWEEN.Tween(camera.position)
.to(target, 1000)
.onComplete(function() {
transitioning = false;
controls.dispose();
controls = new THREE.TrackballControls(camera);
controls.target.set(obj.point.x, obj.point.y, obj.point.z);
}).start();
}
While TWEEN effectively handles transitions between WebVR and Trackball modes, I'm encountering a slight gap at the end of the transition. This discrepancy seems to stem from fluctuations in the camera's rotation during the completion phase.
Does anyone know of a method to ensure a seamless transition between two different camera controls, taking into account both position and rotation?
Thanks,