title: Remove rotating animation from Three.js Cube
body: <p>I have created a 3D wireframe cube from Three.js examples, but it keeps rotating,</p>
  
  <p>I want to stop this animation.</p>
  
  <p>Now when I remove the <code>animate();</code> from the bottom of script, the Canvas doesn't load.</p>
  
  <pre><code>// start animation
  animate();
  &lt;/script&gt;
  </code></pre>
  
  <p>And when I try to remove <code>animate();</code> function from :</p>
  
  <pre><code>    // request new frame
      requestAnimationFrame(function(){
          animate();
      });
  </code></pre>
  
  <p>The animation stops but it takes wierd shape, but <strong>not</strong> the shape of Cube. Also on every refresh it changes the shape.</p>
  
  <p>Here is my code:</p>
  
  <p>Javascript:</p>
  
  <pre><code>    &lt;script defer="defer"&gt;
    // revolutions per second
    var angularSpeed = 0.2; 
  var lastTime = 0;
  
  // this function is executed on each animation frame
  function animate(){
      // update
      var time = (new Date()).getTime();
      var timeDiff = time - lastTime;
      var angleChange = angularSpeed * timeDiff * 2 * Math.PI / 1000;
      cube.rotation.y += angleChange;
      lastTime = time;
  
      // render
      renderer.render(scene, camera);
  
      // request new frame
      requestAnimationFrame(function(){
          animate();
      });
  }
  
  // renderer
  var container = document.getElementById("container");
  var renderer = new THREE.WebGLRenderer();
  renderer.setSize(container.offsetWidth, container.offsetHeight);
  container.appendChild(renderer.domElement);
  
  // camera
  var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000);
  camera.position.z = 700;
  
  // scene
  var scene = new THREE.Scene();
  
  // cube Length, Height, Width
  var cube = new THREE.Mesh(new THREE.CubeGeometry(400, 200, 200), new THREE.MeshBasicMaterial({
      wireframe: true,
      color: '#ff0000'
  }));
  cube.rotation.x = Math.PI * 0.1;
  scene.add(cube);
  
  // start animation
  animate();
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Here is the Fiddle for the same: <a href="http://jsfiddle.net/UsEDt/1/" rel="nofollow noreferrer">http://jsfiddle.net/UsEDt/1/</a></strong></p>
  
  <p>Let me know if you need any other information.</p>
  
  <p>Please suggest.</p>