Animating the Axis

Often when you're animating a rotation around an axis, you want to keep the center properties constant, and the Axis property constant, and animate the Angle property. However, you can also animate the Axis property using a Vector3DAnimation object while keeping everything else constant. The following program demonstrates this technique with a single square figure.

Example 3-11. AnimatingTheAxis.xaml

<!-- =================================================== AnimatingTheAxis.xaml (c) 2007 by Charles Petzold =================================================== --> <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowTitle="Animating the Axis" Title="Animating ...

Get 3D Programming for Windows® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.