2013-11-21 3 views

Antwort

6
controls.autoRotate = false; 

es Starten Sie einfach auf init mit ‚true‘, dann onMouseMove, etwas tun wie:

if (controls.AutoRotate) 
    controls.autoRotate = false; 
+1

Ich habe es getan, vielen Dank. – n2g6t1q1

5

Für Leute googeln, wenn Sie das Autorotate nach der ersten Interaktion stoppen möchten; Sie können auf einem der drei Ereignisse OrbitControls emittiert bis ein Ereignis-Listener Haken:

// stop autorotate after the first interaction 
controls.addEventListener('start', function(){ 
    controls.autoRotate = false; 
}); 

Oder noch weiter fortgeschritten ist, starten Sie den autorotate, nachdem der Benutzer die letzte Interaktion mit einem Timeout von 1000 Millisekunden beendet ist:

// stop autorotate after the first interaction 
controls.addEventListener('start', function(){ 
    clearTimeout(autorotateTimeout); 
    controls.autoRotate = false; 
}); 

// restart autorotate after the last interaction & an idle time has passed 
this.controls.addEventListener('end', function(){ 
    autorotateTimeout = setTimeout(function(){ 
    controls.autoRotate = true; 
    }, 1000); 
});