auto-rotate brain, disable pan and zoom

This commit is contained in:
Mahdi Dibaiee 2021-10-18 20:30:57 +01:00
parent b29673a97e
commit bf74367689

View File

@ -10,11 +10,13 @@ renderer.setSize(width, height);
const canvas = document.getElementById('brain-container');
canvas.appendChild( renderer.domElement );
{
const controls = new THREE.OrbitControls(camera, canvas);
controls.target.set(0, 0.5, 0);
controls.update();
}
// Controls
const controls = new THREE.OrbitControls(camera, canvas);
controls.enablePan = false;
controls.enableZoom = false;
controls.autoRotate = true;
controls.target.set(0, 0.5, 0);
controls.update();
// Lights
{
@ -63,6 +65,7 @@ var highlightIndex = 0;
function render() {
renderer.render(scene, camera);
controls.update();
if (brain) {
highlightProgress += 0.025;