title: Sequence of animations in WPF with BeginAnimation
body: <p>I'm trying to animate some rotations in 3D with WPF and if I trigger them manually (on click) everything is fine, but if I compute the movements that should be made on the Viewport3D all animations seem to go off at the same time.</p>
  
  <p>The code that computes the movements is as follows:</p>
  
  <pre><code>for(int i=0; i&lt;40; i++){
      foo(i);
  }
  </code></pre>
  
  <p>Where the <code>foo(int i)</code> looks like:</p>
  
  <pre><code>//compute axis, angle
  AxisAngleRotation3D rotation = new AxisAngleRotation3D(axis, angle);
  RotateTransform3D transform = new RotateTransform3D(rotation, new Point3D(0, 0, 0));
  DoubleAnimation animation = new DoubleAnimation(0, angle, TimeSpan.FromMilliseconds(370)); 
  
  rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, animation);
  </code></pre>
  
  <p>The computation of <code>axis</code> and <code>angle</code> is not something time consuming, simple attributions, so I guess the problem is that all animations trigger the next frame since the computations are already done when the current frame is "over".</p>
  
  <p>How can I display those animations sequentially, rather than all at once, in code (not XAML)?</p>
  
  <p>PS: everything is in C#, no XAML.</p>