title: How to make a smooth rotation of a 3D plot in MATLAB?
body: <p>If I try to rotate camera around my current figure with <code>plot3</code> using</p>
  
  <pre><code>while true; camorbit(0.9,-0.1); drawnow; end
  </code></pre>
  
  <p>then the rotation periodically hangs for a while (<a href="http://www.vimeo.com/17344094" rel="noreferrer">example</a>) even on 8-core MacPro.</p>
  
  <p>Can I make it smooth?</p>
  
  <p>EDIT1:</p>
  
  <p>While there is no solution for my original question yet, I've managed to make a better movie with <code>getframe</code> function. It doesn't allow recording free-hand rotation, though, and is quite buggy in MATLAB2010b for Mac.</p>
  
  <pre><code>%# fix wrong figure position in MATLAB2010b for Mac - depends on your layout
  correctedPosition = get(gcf,'Position') + [21 -125 0 0];
  
  fps = 60; sec = 10;
  
  vidObj = VideoWriter('newfile.avi');
  vidObj.Quality = 100;
  vidObj.FrameRate = fps;
  
  open(vidObj);
  for i=1:fps*sec
    camorbit(0.9,-0.1);
    writeVideo(vidObj,getframe(gcf, correctedPosition));
  end
  close(vidObj);
  </code></pre>
  
  <p>EDIT2:</p>
  
  <p>I created a similar thread at <a href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/297953" rel="noreferrer">MATLAB Central</a>.</p>
  
  <p>EDIT3:</p>
  
  <p>You can try it yourself <a href="https://docs.google.com/leaf?id=0B97K-L6bqPnnYjkyYTViZjQtNzAxOS00ZTkwLTk1YTgtMjUzMjNiNjlmNzcz&amp;pli=1" rel="noreferrer">downloading one of my figures</a>.</p>