|
<Window x:Class="WpfRendering.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:w="clr-namespace:OpenSource.Wpf3D"
xmlns:local="clr-namespace:WpfRendering"
Title="WPF to Kerkythea exporter" Height="600" Width="900" Background="#101010">
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="File">
<MenuItem Header="Export to Kerkythea" Click="Export_Click"/>
<MenuItem Header="Start Kerkythea..." Click="StartKerkyThea_Click"/>
<Separator/>
<MenuItem Header="Exit" Command="ApplicationCommands.Close"/>
</MenuItem>
</Menu>
<Viewport3D Name="View1">
<!-- The camera -->
<Viewport3D.Camera>
<PerspectiveCamera Position="8,6,5" LookDirection="-8,-6,-5" UpDirection="0,0,1" FieldOfView="60" />
</Viewport3D.Camera>
<!-- Scene -->
<w:Sphere3D x:Name="sphere1" Fill="Red" Radius="0.5" Center="1.5,0,1"/>
<w:Sphere3D x:Name="sphere2" Fill="Green" Radius="0.5" Center="0,1.5,1"/>
<w:Sphere3D x:Name="sphere3" Fill="Blue" Radius="0.5" Center="0,0,2.5"/>
<w:Sphere3D x:Name="sphere4" Fill="Yellow" Radius="0.5" Center="0,0,1"/>
<!-- Todo: Earth globe, support textures -->
<!--
<w:Sphere3D x:Name="sphere" Radius="1" PhiDiv="20" ThetaDiv="20" Center="2,-2,1">
<w:Sphere3D.Transform>
<RotateTransform3D CenterX="2" CenterY="-2">
<RotateTransform3D.Rotation>
<AxisAngleRotation3D x:Name="myAngleRotation" Axis="0,0,1" Angle="220" />
</RotateTransform3D.Rotation>
</RotateTransform3D>
</w:Sphere3D.Transform>
<w:Sphere3D.Material>
<MaterialGroup>
<DiffuseMaterial Color="White">
<DiffuseMaterial.Brush>
<ImageBrush ImageSource="Images/earth.jpg"/>
</DiffuseMaterial.Brush>
</DiffuseMaterial>
<SpecularMaterial Color="White" SpecularPower="250"/>
</MaterialGroup>
</w:Sphere3D.Material>
</w:Sphere3D>
-->
<w:Checkerboard3D x:Name="checkerboard" SquareSize="1">
<w:Checkerboard3D.Transform>
<TranslateTransform3D OffsetX="-4" OffsetY="-4" OffsetZ="0"/>
</w:Checkerboard3D.Transform>
</w:Checkerboard3D>
<!-- Lights -->
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup>
<Model3DGroup.Children>
<AmbientLight Color="#000000"/>
<SpotLight x:Name="SpotLight1" Color="#ffffff" Position="0,5,5" Direction="0,-3,-3" LinearAttenuation="0.1"/>
<DirectionalLight x:Name="Light1" Color="#606060" Direction="-1,0,0"/>
<DirectionalLight x:Name="Light2" Color="#606060" Direction="0,0,-1"/>
</Model3DGroup.Children>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
</DockPanel>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.