title: three.js - Uncaught TypeError: Cannot read property 'x' of undefined
body: <p>I found the reference code from github and other questions about object rotation on stackoverflow.</p>
  
  <pre><code>var vector = new THREE.Vector3( 1, 0, 0 );
          var axis = new THREE.Vector3( 1, 0, 0 ).normalize();
          var angle = Math.PI / 2;                
  
          function rotateAroundWorldAxis(object, axis, angle) {                                               
              var matrix = new THREE.Matrix4().makeRotationAxis( axis, angle );
              matrix.multiplyVector3( vector );
              object.matrix = matrix;
              object.rotation.setEulerFromRotationMatrix(object.matrix);
          }
  
          function render() {                     
              rotateAroundWorldAxis(tubeMesh, axis, angle);
              renderer.render( scene, camera );
          }
  </code></pre>
  
  <p>I can't figure out what could be the reason of the error "Uncaught TypeError: Cannot read property 'x' of undefined."
  In google chrome it shows as </p>
  
  <ul>
  <li>Uncaught TypeError: Cannot read property 'x' of undefined at three.min.js:56</li>
  <li>THREE.Matrix4.makeRotationAxis at three.min.js:56</li>
  <li>rotateAroundWorldAxis at my_model.htm:290</li>
  <li>render at my_model.htm:297</li>
  <li>animate</li>
  </ul>
  
  <p>The error is in <code>three.min.js</code> at line no. 56. 
  I am using r51 of three.js library.</p>