title: THREE.js: Why is my object flipping whilst travelling along a spline?
body: <p>Following up from my original post <a href="https://stackoverflow.com/questions/18400667/three-js-object-following-a-spline-path-rotation-tanget-issues-constant-sp">Three.JS Object following a spline path - rotation / tangent issues &amp; constant speed issue</a>, I am still having the issue that the object flips at certain points along the path.</p>
  
  <p>View this happening on this fiddle: <a href="http://jsfiddle.net/jayfield1979/T2t59/7/" rel="nofollow noreferrer">http://jsfiddle.net/jayfield1979/T2t59/7/</a> </p>
  
  <pre><code>function moveBox() {
  if (counter &lt;= 1) {
  
      box.position.x = spline.getPointAt(counter).x;
      box.position.y = spline.getPointAt(counter).y;
  
      tangent = spline.getTangentAt(counter).normalize();
  
      axis.cross(up, tangent).normalize();
  
      var radians = Math.acos(up.dot(tangent));
  
      box.quaternion.setFromAxisAngle(axis, radians);
  
      counter += 0.005
  } else {
      counter = 0;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The above code is what moves my objects along the defined spline path (an oval in this instance). It was mentioned by @WestLangley that: "Warning: cross product is not well-defined if the two vectors are parallel.".</p>
  
  <p>As you can see, from the shape of the path, I am going to encounter a number of parallel vectors. Is there anything I can do to prevent this flipping from happening?</p>