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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
<Window x:Class="WpfCubeLord.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfCubeLord"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Canvas>
<Button
Content="rot.droite"
Name="rotationDroite"
Click="rotationDroite_Click" />
<Label x:Name="lblDroite" Content="droite" Margin="150,0,0,20"/>
<TextBlock x:Name="tbDroite" Background="BlanchedAlmond" Margin="250,0,0,20"/>
<Button
Content="rot.gauche"
Name="rotationGauche"
Margin="30"
Click="rotationGauche_Click" />
<Label x:Name="lblGauche" Content="gauche" Margin="150,30,0,20"/>
<TextBlock x:Name="tbGauche" Background="BlanchedAlmond" Margin="250,30,0,20"/>
<Button
Content="rot.basgauche"
Name="rotationBasGauche"
Margin="60"
Click="rotationBasGauche_Click" />
<Label x:Name="lblBasGaucheX" Content="BasX" Margin="150,60,0,20"/>
<TextBlock x:Name="tbBGAngleX" Background="BlanchedAlmond" Margin="250,60,0,20"/>
<Label x:Name="lblBasGaucheY" Content="GaucheY" Margin="150,90,0,20"/>
<TextBlock x:Name="tbBGAngleY" Background="BlanchedAlmond" Margin="250,90,0,20"/>
<Button
Content="infos"
Name="infos"
Margin="60,0,0,0" Click="infos_Click" />
<Viewbox
x:Name="viewbox"
ClipToBounds="true">
<Viewport3D
x:Name="viewport"
ClipToBounds="true"
Width="600"
Height="800">
<Viewport3D.Resources>
<ResourceDictionary>
<MaterialGroup x:Key="compteurMR1">
<DiffuseMaterial
Brush="LightBlue">
</DiffuseMaterial>
</MaterialGroup>
<Transform3DGroup
x:Key="SceneTR7">
<TranslateTransform3D
OffsetX="0" OffsetY="0" OffsetZ="0" />
<ScaleTransform3D
ScaleX="1" ScaleY="1" ScaleZ="1" />
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Angle="0" Axis="0 1 0" />
</RotateTransform3D.Rotation>
</RotateTransform3D>
<TranslateTransform3D
OffsetX="0" OffsetY="0" OffsetZ="0" />
</Transform3DGroup>
<Transform3DGroup
x:Key="CubeOR9TR8">
<TranslateTransform3D
OffsetX="0.0453084"
OffsetY="-0.0790308"
OffsetZ="-0.0187794" />
<ScaleTransform3D
ScaleX="1" ScaleY="1" ScaleZ="1" />
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D
Angle="179.2757609" Axis="0.007474061364 -0.9998974132 -0.01221889765" />
</RotateTransform3D.Rotation>
</RotateTransform3D>
<TranslateTransform3D
OffsetX="-0.0453084" OffsetY="0.0790308" OffsetZ="0.0187794" />
</Transform3DGroup>
<local:CubeGeometry
x:Key="CubeOR9GR10"
Center="0,0,0"
Length="1.0"
Width="1.0"
Height="1.5"/>
</ResourceDictionary>
</Viewport3D.Resources>
<Viewport3D.Camera>
<PerspectiveCamera
x:Name="Camera"
Position="2,2,2"
LookDirection="-2,-2,-2"
UpDirection="0,1,0"
FieldOfView="60.000"
/>
</Viewport3D.Camera>
<ModelVisual3D x:Name="Compteur">
<ModelVisual3D.Content>
<Model3DGroup
x:Name="Scene" Transform="{DynamicResource SceneTR7}">
<!-- Scene (XAML Path = ) -->
<!--<AmbientLight Color="LightGray" />-->
<!--<DirectionalLight
Color="Gray"
Direction="-1,-2,-1.5" />-->
<SpotLight Color="Blue" Position="1,1,8" Direction="-2,-2,-2" InnerConeAngle="90" OuterConeAngle="270"/>
<SpotLight Color="Yellow" Position="4,20,4" Direction="-1.0,-1.0,-1.0" InnerConeAngle="90.0" OuterConeAngle="180"/>
<SpotLight Color="Red" Position="-1,-1,-8" Direction="2.0,2.0,2.0" InnerConeAngle="90.0" OuterConeAngle="270"/>
<Model3DGroup
x:Name="CubeOR9"
Transform="{DynamicResource CubeOR9TR8}">
<!-- Cube (XAML Path = (Viewport3D.Children)[0].(ModelVisual3D.Content).(Model3DGroup.Children)[3]) -->
<GeometryModel3D
x:Name="CubeOR9GR10"
Geometry="{Binding Source={StaticResource CubeOR9GR10},Path=Mesh3D }">
<GeometryModel3D.Material>
<DiffuseMaterial Brush="LightBlue"/>
</GeometryModel3D.Material>
<GeometryModel3D.BackMaterial>
<DiffuseMaterial Brush="Blue"/>
</GeometryModel3D.BackMaterial>
</GeometryModel3D>
</Model3DGroup>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
</Viewbox>
</Canvas>
</Grid>
</Window> |
Partager