How can I make the orbitcontrols focus on a selected object for navigation? I see there is a center/target attribute, but I'm unsure how to set it to the object I have chosen.
I attempted the following:
var controls = this.controls = new THREE.EditorControls(camera, container.dom);
this.orbitControls = new THREE.OrbitControls( camera );
this.orbitControls.damping = 0.5;
this.orbitControls.addEventListener( 'change', SceneManager.animate );
var controls = this.controls = new THREE.OrbitControls(camera, container.dom);
onObjectselected(function(o){
controls.center.fromArray([o.position.x, o.position.y, o.position.z]);
});
controls.addEventListener('change', function () {
thisView.transformControls.update();
thisView.orbitControls.update();
SignalHub.signals.cameraChanged.dispatch(camera);
});
However, I am not seeing any outcomes from this code. It was built upon the threejs editor as reference.