Be warned: the ability to do nested animations will likely go away in future releases of Avalon. The recommendation is to use storyboards to wire up all animations. Below is a sample of wiring up a 3D animation in XAML from the introducing Avalon article
on MSDN:
http://msdn.microsoft.com/Longhorn/archive/default.aspx?pull=/library/en-us/dnlong/html/avalonmarch2005ctp.asp
The sample also shows off VisualBrush, which is a pretty nifty feature...
The sample also shows off VisualBrush, which is a pretty nifty feature...
<Window xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" > < Window.Storyboards> <ParallelTimeline> <SetterTimeline TargetID="myViewport3D" Path="(Viewport3D.Models).(Model3DGroup.Children)[2].(GeometryModel3D.Transform).(RotateTransform3D.Rotation).Angle"> <DoubleAnimation From="0" To="360" Duration="0:0:5" RepeatBehavior="Forever" /> </SetterTimeline> </ParallelTimeline> </ Window.Storyboards> <Grid Background="#333399"> <Grid.Resources> <MeshGeometry3D x:Key="PlaneMesh" Positions="-1 -1 -0.5 1 -1 -0.5 -1 1 -0.5 1 1 -0.5 0 0 1" Normals="-1 -1 1 1 -1 1 -1 1 1 1 1 1 0 0 1" TextureCoordinates="0 1 1 1 0 0 1 0 0.5 0.5 " TriangleIndices="0 4 2 2 4 3 4 1 3 0 1 4" /> </Grid.Resources> <Viewport3D ID="myViewport3D" ClipToBounds="true" Height="480" Width="640" Focusable="true"> <Viewport3D.Camera> <PerspectiveCamera LookAtPoint="0,0,0" Position="0,0,5.0" Up="0,1,0" NearPlaneDistance="0.25" FarPlaneDistance="20" FieldOfView="60" > </PerspectiveCamera> </Viewport3D.Camera> <Viewport3D.Models > <AmbientLight Color="#FF0F0F0F" /> <DirectionalLight Direction="1 1 -1" /> <GeometryModel3D Geometry="{PlaneMesh}" StatusOfNextUse="ChangeableReference" > <GeometryModel3D.Material> <BrushMaterial > <BrushMaterial.Brush> <VisualBrush Viewbox="0,0,100,100"> <VisualBrush.Visual> <Grid Background="green"> <StackPanel Width="200" Height="200" Background="yellow"> <Button></Button> <TextFlow>This is some text. Watch how it wraps around the 3d model.</TextFlow> </StackPanel> </Grid> </VisualBrush.Visual> </VisualBrush> </BrushMaterial.Brush> </BrushMaterial> </GeometryModel3D.Material> <GeometryModel3D.Transform > <RotateTransform3D Center="0 0 0" > <RotateTransform3D.Rotation> <Rotation3D Axis="0 1 1" Angle="40" > </Rotation3D> </RotateTransform3D.Rotation> </RotateTransform3D> </GeometryModel3D.Transform> </GeometryModel3D> </Viewport3D.Models> </Viewport3D> </Grid> </ Window >