O'Reilly logo

3D Game Development with Microsoft Silverlight 3 Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—animating projections

Your project manager wants you to animate the perspective transform applied to the video while it is being reproduced.

We are going to add a StoryBoard in XAML code to animate the PlaneProjection instance:

  1. Stay in the project, 3DInvadersSilverlight.
  2. Open MainPage.xaml and replace the PlaneProjection definition with the following line (we have to add a name to refer to it):
    <PlaneProjection x:Name ="proIntroduction" RotationX="-40"
    RotationY="15" RotationZ="-6" LocalOffsetX="-70"
    LocalOffsetY="-105" />
    
  3. Add the following lines of code before the end of the definition of the cnvVideo Canvas:
    <Canvas.Resources> <Storyboard x:Name="introductionSB"> <DoubleAnimation Storyboard.TargetName="proIntroduction" Storyboard.TargetProperty="RotationX" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required