auto-rotate brain, disable pan and zoom
This commit is contained in:
parent
b29673a97e
commit
bf74367689
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user