XAML Code for QUT Lecture Oct 11th



<Window x:Class=Window1


xmlns=http://schemas.microsoft.com/winfx/avalon/2005


xmlns:x=http://schemas.microsoft.com/winfx/xaml/2005


Title=AvalonApplication1


>


<Grid Background>




<Viewport3D>


<Viewport3D.Camera>


<PerspectiveCamera Position=0,0,5 LookAtPoint=0,0,0 Up=0,1,0 FieldOfView=45 NearPlaneDistance=1 FarPlaneDistance=20/>


</Viewport3D.Camera>


<Viewport3D.Models>


<Model3DGroup >


<AmbientLight Color=White />


<GeometryModel3D>


<GeometryModel3D.Geometry>


<MeshGeometry3D


TriangleIndices=0,1,2 3,4,5 6,7,8 9,10,11 12,13,14 15,16,17 18,19,20 21,22,23 24,25,26 27,28,29 30,31,32 33,34,35


Normals=0,0,-1 0,0,-1 0,0,-1 0,0,-1 0,0,-1 0,0,-1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,-1,0 0,-1,0 0,-1,0 0,-1,0 0,-1,0 0,-1,0 1,0,0 1,0,0 1,0,0 1,0,0 1,0,0 1,0,0 0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 -1,0,0 -1,0,0 -1,0,0 -1,0,0 -1,0,0 -1,0,0


TextureCoordinates=1,1 1,0 0,0 0,0 0,1 1,1 0,1 1,1 1,0 1,0 0,0 0,1 0,1 1,1 1,0 1,0 0,0 0,1 1,1 1,0 0,0 0,0 0,1 1,1 1,0 0,0 0,1 0,1 1,1 1,0 0,0 0,1 1,1 1,1 1,0 0,0


Positions=-0.5,-0.5,-0.5 -0.5,0.5,-0.5 0.5,0.5,-0.5 0.5,0.5,-0.5 0.5,-0.5,-0.5 -0.5,-0.5,-0.5 -0.5,-0.5,0.5 0.5,-0.5,0.5 0.5,0.5,0.5 0.5,0.5,0.5 -0.5,0.5,0.5 -0.5,-0.5,0.5 -0.5,-0.5,-0.5 0.5,-0.5,-0.5 0.5,-0.5,0.5 0.5,-0.5,0.5 -0.5,-0.5,0.5 -0.5,-0.5,-0.5 0.5,-0.5,-0.5 0.5,0.5,-0.5 0.5,0.5,0.5 0.5,0.5,0.5 0.5,-0.5,0.5 0.5,-0.5,-0.5 0.5,0.5,-0.5 -0.5,0.5,-0.5 -0.5,0.5,0.5 -0.5,0.5,0.5 0.5,0.5,0.5 0.5,0.5,-0.5 -0.5,0.5,-0.5 -0.5,-0.5,-0.5 -0.5,-0.5,0.5 -0.5,-0.5,0.5 -0.5,0.5,0.5 -0.5,0.5,-0.5 />


</GeometryModel3D.Geometry>


<GeometryModel3D.Transform>


<RotateTransform3D>


<RotateTransform3D.Rotation>


<Rotation3D x:Name=MyRotation3D Angle=45 Axis=0 1 0/>


</RotateTransform3D.Rotation>


</RotateTransform3D>


</GeometryModel3D.Transform>



<GeometryModel3D.Material>


<DiffuseMaterial>


<DiffuseMaterial.Brush>


<VisualBrush>


<VisualBrush.Visual>


<Path>


<Path.Data>


<EllipseGeometry Center=200 200 RadiusX=150 RadiusY=150 />–>


</Path.Data>


<Path.Fill>


<VisualBrush>


<VisualBrush.Visual>


<!–<TextBlock>Hello QUT</TextBlock>–>


<MediaElement Source=C:\apollo11_launchclip04.mpg/>


</VisualBrush.Visual>


</VisualBrush>


</Path.Fill>


</Path>


</VisualBrush.Visual>


</VisualBrush>


</DiffuseMaterial.Brush>


</DiffuseMaterial>


</GeometryModel3D.Material>


</GeometryModel3D>


</Model3DGroup>


</Viewport3D.Models>




<Viewport3D.Triggers>


<EventTrigger RoutedEvent=Viewport3D.Loaded>


<EventTrigger.Actions>


<BeginStoryboard>


<Storyboard>


<DoubleAnimation From=0 To=360 Duration=0:0:3


Storyboard.TargetName=MyRotation3D


Storyboard.TargetProperty=Angle RepeatBehavior=Forever />


</Storyboard>


</BeginStoryboard>



</EventTrigger.Actions>


</EventTrigger>


</Viewport3D.Triggers>


</Viewport3D>


</Grid>


</Window>


Comments (0)