瀏覽代碼

Disable animation loop

This modification emphasizes that an animation loop is unnecessary for a static scene.
Paul Masson 8 年之前
父節點
當前提交
159508766c
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      examples/misc_controls_orbit.html

+ 5 - 4
examples/misc_controls_orbit.html

@@ -53,7 +53,7 @@
 			var camera, controls, scene, renderer;
 
 			init();
-			animate();
+			//animate();
 
 			function init() {
 
@@ -72,9 +72,10 @@
 				camera.position.z = 500;
 
 				controls = new THREE.OrbitControls( camera, renderer.domElement );
-				//controls.addEventListener( 'change', render ); // add this only if there is no animation loop (requestAnimationFrame)
-				controls.enableDamping = true;
-				controls.dampingFactor = 0.25;
+				controls.addEventListener( 'change', render ); // remove when using animation loop (requestAnimationFrame)
+				// enable animation loop when using damping or autorotation
+				//controls.enableDamping = true;
+				//controls.dampingFactor = 0.25;
 				controls.enableZoom = false;
 
 				// world