<Window.Triggers> <EventTrigger SourceName="button1" RoutedEvent= "Button.Click"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard Name="myStoryBoardX"> <DoubleAnimation Storyboard.TargetName="rotationX" Storyboard.TargetProperty="Angle" From="0" To="360" Duration="0:0:15" RepeatBehavior="Forever"/> </Storyboard> </BeginStoryboard> <BeginStoryboard> <Storyboard Name="myStoryBoardY"> <DoubleAnimation Storyboard.TargetName="rotationY" Storyboard.TargetProperty="Angle" From="0" To="360" Duration="0:0:12" RepeatBehavior="Forever"/> </Storyboard> </BeginStoryboard> <BeginStoryboard> <Storyboard TargetName="translate"> <DoubleAnimation Storyboard.TargetProperty="OffsetX" From="0" To="20" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" /> <DoubleAnimation Storyboard.TargetProperty="OffsetZ" From="0" To="-20" Duration="0:0:10" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Window.Triggers>
<ModelVisual3D x:Name ="visual"> <ModelVisual3D.Transform> <Transform3DGroup> <TranslateTransform3D x:Name="translate"> </TranslateTransform3D> <RotateTransform3D> <RotateTransform3D.Rotation> <AxisAngleRotation3D x:Name="rotationY" Angle="0" Axis="0,1,0" /> </RotateTransform3D.Rotation> </RotateTransform3D> <RotateTransform3D> <RotateTransform3D.Rotation> <AxisAngleRotation3D x:Name="rotationX" Angle="0" Axis="1,0,0" /> </RotateTransform3D.Rotation> </RotateTransform3D> </Transform3DGroup> </ModelVisual3D.Transform> </ModelVisual3D>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)