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