title: Slow 3D rotation with antialiasing in Mathematica 7
body: <p>3D surface rotation in <em>Mathematica</em> 7 with anti-aliasing turned off is very fast and smooth.  However, turning on anti-aliasing, even at a moderate level, drastically reduces the rendered frame rate, making rotation very choppy.  This happens to a much greater degree in <em>Mathematica</em> than it does in other 3D applications.</p>
  
  <ol>
  <li><p>Why is anti-aliasing disproportionately slower in <em>Mathematica</em>?</p></li>
  <li><p>A way to greatly enhance the feel of 3D graphics would be to turn off AA during rotation, but turn it on as soon as rotation is stopped.  Can this be done in <em>Mathematica</em> 7?</p></li>
  </ol>
  
  <hr>
  
  <p>An example was requested.  I will use a variation of Mike's code.  Please try the following with <code>Edit &gt; Preferences &gt; Appearance &gt; Graphics</code> first set to <code>No antialiasing</code> and then <code>Highest quality</code>.  Also try the settings in between.  For me, any setting besides <code>No antialiasing</code> is not smooth.  I can visually distinguish three different levels of AA, so it is not a matter of my GPU forcing all or none, yet all of them are slow.</p>
  
  <pre><code>Animate[Plot3D[{x^2 + y^2, -x^2 - y^2}, {x, -2, 2}, {y, -2, 2},
    ImageSize -&gt; 700,
    ViewPoint -&gt; 
     Dynamic[{Sin[theta] Cos[phi], Sin[theta] Sin[phi], Cos[theta]}]],
   {theta, 0, Pi}, {phi, 0, 2 Pi},
   RefreshRate -&gt; 120
  ]
  </code></pre>
  
  <hr>
  
  <h1>UPDATE and OBSERVATION</h1>
  
  <p>While playing around with Alexey and Mike's code, something strange and good happened.  I suddenly have smooth antialiased rotation!  I don't know what precipitated the change, and I have not closed <em>Mathematica</em> for fear that it will go away, but this proves what I suspected, that it CAN be fast.</p>
  
  <p>More strange, I have the slow and fast behavior happening <em>in parallel</em> in the same notebook.  One graphic is rotating smoothly, and another produced with the same code is choppy.  I theorize that some cell option was modified by running Alexey and Mike's code, and it is having a very desirable effect.  I am going to do my best to figure out what it is.</p>
  
  <hr>
  
  <p>The helpful options were <code>RotationAction -&gt; "Clip", SphericalRegion -&gt; True</code> that appeared in Alexey's code incidentally.  These, or their effect (<code>ViewAngle</code>), "stick" with a graphic in the same way that rotation does, therefore I was able to type new code without these options over the old, and run it, and still get the smooth rotation (which explains what I saw above).  See answers below for some elaboration.</p>
  
  <p>While a viable workaround has been discovered, I am still interested in an explanation for the choppy rotation with AA on.  I do not believe that the "fitting" of the graphic is an explanation, but merely a correlation, as the fitting still needs to take place with AA off, and yet the rotation is smooth.</p>