title: calculate camera fov distance for sphere
body: <p>I trying to calculate the max distance the camera can zoom in on a sphere while still displaying all of the sphere on screen.</p>
  
  <pre><code>var dist =  diameter / (2 * Math.tan( camera.fov * (Math.PI/180) / 2 ));
  </code></pre>
  
  <p>this zooms in to much. The top and bottom of the sphere are clipped.
  What am i doing wrong?</p>
  
  <p><a href="http://jsfiddle.net/x98Fk/1/" rel="nofollow">fiddle</a></p>