Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Principles of Microsoft Silverlight Animation

805 views

Published on

Come and learn the fundamentals of Silverlight animation. Start at the beginning with a review of storyboards and keyframes, and then break free from storyboards and explore procedural animations. This is where the rubber meets the road and your objects come to life-vectors, frame-based animations, collisions, particle systems, and VR objects.

Published in: Business, Technology
  • Be the first to comment

Principles of Microsoft Silverlight Animation

  1. 1. “This book is easily worth ten times the money. I haven't seen a better book about animation in Silverlight yet.” “The descriptions of how it works and WHY to do something a certain way are priceless. I had several quot;Oh, now I get itquot; reactions over the course of reading this book.” “My best reviews are reserved for books that teach the material well and completely. This is the best of the books on Silverlight that I've purchased. It rates five stars in my world.”
  2. 2. <Storyboard x:Name=quot;Storyboard1quot;/>
  3. 3. <Storyboard x:Name=quot;Storyboard1quot;> <DoubleAnimationUsingKeyFrames BeginTime=quot;00:00:00quot; Storyboard.TargetName=quot;ellipsequot; Storyboard.TargetProperty=quot;(UIElement.RenderTr ansform).(TransformGroup.Children)[3].(TranslateTran sform.X)quot;> <SplineDoubleKeyFrame KeyTime=quot;00:00:01quot; Value=quot;370quot;/> </DoubleAnimationUsingKeyFrames> </Storyboard>
  4. 4. <SplineDoubleKeyFrame KeyTime=quot;00:00:01quot; Value=quot;370quot;/>
  5. 5. <LinearDoubleKeyFrame KeyTime=quot;00:00:01quot; Value=quot;370quot;/> <SplineDoubleKeyFrame KeyTime=quot;00:00:01quot; Value=quot;370quot;/> <SplineDoubleKeyFrame KeyTime=quot;00:00:01quot; Value=quot;370quot; KeySpline=quot;0,0,0.50,1quot;/> <DiscreteDoubleKeyFrame KeyTime=quot;00:00:01quot; Value=quot;370quot;/>
  6. 6. Linear Spline Discrete
  7. 7. Models Remixed Data Visualization
  8. 8. 0,0 +X +Y LayoutRoot Canvas
  9. 9. 0,0 +X +Y LayoutRoot Canvas
  10. 10. 0,0 +X 5,-5 5,5 Multiply the Y component by -1 to reverse direction +Y LayoutRoot Canvas
  11. 11. private Point ObjPosition; private double VelocityX = 1; private double VelocityY = -2;
  12. 12. private void Move_Completed(object sender, EventArgs e) { }
  13. 13. VelocityY += Gravity; ObjPosition.X += VelocityX; ObjPosition.Y += VelocityY; Canvas.SetLeft(MyObject, ObjPosition.X); Canvas.SetTop(MyObject, ObjPosition.Y);
  14. 14. Move.Begin();
  15. 15. Ball Drop
  16. 16. Dog Walk
  17. 17. Space Marine
  18. 18. Visual State Manager
  19. 19. private void MoveParticles(object sender, EventArgs e) { }
  20. 20. for (int i = 0; i < Particles.Count; i++) { }
  21. 21. Canvas.SetLeft(Particles[i], Canvas.GetLeft(Particles[i]) + Particles[i].Velocity.X); Canvas.SetTop(Particles[i], Canvas.GetTop(Particles[i]) + Particles[i].Velocity.Y);
  22. 22. Particles[i].Age += 1;
  23. 23. if (Particles[i].Age >= Particles[i].LifeSpan) { LayoutRoot.Children.Remove(Particles[i]); Particles.Remove(Particles[i]); CreateParticles(1); }
  24. 24. Move.Begin();
  25. 25. private void MoveParticles(object sender, EventArgs e) { for (int i = 0; i < Particles.Count; i++) { Canvas.SetLeft(Particles[i], Canvas.GetLeft(Particles[i]) + Particles[i].Velocity.X); Canvas.SetTop(Particles[i], Canvas.GetTop(Particles[i]) + Particles[i].Velocity.Y); Particles[i].Age += 1; if (Particles[i].Age >= Particles[i].LifeSpan) { LayoutRoot.Children.Remove(Particles[i]); Particles.Remove(Particles[i]); CreateParticles(1); } } Move.Begin(); }
  26. 26. Basic System
  27. 27. Comet Fountain
  28. 28. Single plane (Bed) Multi-plane (Mini Cooper)
  29. 29. Your feedback is important!
  30. 30. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

×