147 lines
7.9 KiB
XML
147 lines
7.9 KiB
XML
<UserControl
|
|
x:Class="_20230724_MBJC_upperpc.Views.FirstPageView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:_20230724_MBJC_upperpc.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:tool="clr-namespace:_3DTools;assembly=3DTools"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
mc:Ignorable="d">
|
|
<Grid Background="Gray">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<tool:TrackballDecorator Name="tra">
|
|
<Viewport3D
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
Width="500"
|
|
Height="500"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Bottom">
|
|
<Viewport3D.Camera>
|
|
<!--<PerspectiveCamera Position="0,2.5,10" LookDirection="0,-0.1,-1" NearPlaneDistance="1" FarPlaneDistance="10" />-->
|
|
<PerspectiveCamera
|
|
FarPlaneDistance="50"
|
|
LookDirection="-0.5,-0.5,-1"
|
|
NearPlaneDistance="1"
|
|
Position="4,4,8" x:Name="camera1" />
|
|
</Viewport3D.Camera>
|
|
<Viewport3D.Children>
|
|
<ModelVisual3D>
|
|
<ModelVisual3D.Children>
|
|
<ModelVisual3D>
|
|
<ModelVisual3D.Content>
|
|
<GeometryModel3D>
|
|
<GeometryModel3D.Geometry>
|
|
<MeshGeometry3D
|
|
Normals="0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1"
|
|
Positions="0,-0.2,0 0,0.2,0 4,0.2,0 4,0.4,0 5,0,0 4,-0.4,0 4,-0.2,0"
|
|
TriangleIndices="0 2 1 0 6 2 2 4 3 6 4 2 5 4 6 1 2 0 2 6 0 3 4 2 2 4 6 6 4 5" />
|
|
</GeometryModel3D.Geometry>
|
|
<GeometryModel3D.Material>
|
|
<DiffuseMaterial>
|
|
<DiffuseMaterial.Brush>
|
|
<SolidColorBrush Opacity="0.5" Color="Red" />
|
|
</DiffuseMaterial.Brush>
|
|
</DiffuseMaterial>
|
|
</GeometryModel3D.Material>
|
|
</GeometryModel3D>
|
|
</ModelVisual3D.Content>
|
|
</ModelVisual3D>
|
|
<ModelVisual3D>
|
|
<ModelVisual3D.Content>
|
|
<GeometryModel3D>
|
|
<GeometryModel3D.Geometry>
|
|
<MeshGeometry3D
|
|
Normals="0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1"
|
|
Positions="0,-0.2,0 0,0.2,0 0,0.2,4 0,0.4,4 0,0,5 0,-0.4,4 0,-0.2,4"
|
|
TriangleIndices="6 0 1 6 1 2 4 2 3 4 6 2 4 5 6 1 0 6 2 1 6 3 2 4 2 6 4 6 5 4" />
|
|
</GeometryModel3D.Geometry>
|
|
<GeometryModel3D.Material>
|
|
<DiffuseMaterial>
|
|
<DiffuseMaterial.Brush>
|
|
<SolidColorBrush Opacity="0.5" Color="Blue" />
|
|
</DiffuseMaterial.Brush>
|
|
</DiffuseMaterial>
|
|
</GeometryModel3D.Material>
|
|
</GeometryModel3D>
|
|
</ModelVisual3D.Content>
|
|
</ModelVisual3D>
|
|
<ModelVisual3D>
|
|
<ModelVisual3D.Content>
|
|
<GeometryModel3D>
|
|
<GeometryModel3D.Geometry>
|
|
<MeshGeometry3D
|
|
Normals="0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1"
|
|
Positions="0,0,0.2 0,0,-0.2 0,5,-0.2 0,5,-0.4 0,6,0 0,5,0.4 0,5,0.2"
|
|
TriangleIndices="0 1 2 6 0 2 4 2 3 4 6 2 4 5 6 2 1 0 2 0 6 3 2 4 2 6 4 6 5 4 0 1 2 6 0 2" />
|
|
</GeometryModel3D.Geometry>
|
|
<GeometryModel3D.Material>
|
|
<DiffuseMaterial>
|
|
<DiffuseMaterial.Brush>
|
|
<SolidColorBrush Opacity="0.3" Color="Yellow" />
|
|
</DiffuseMaterial.Brush>
|
|
</DiffuseMaterial>
|
|
</GeometryModel3D.Material>
|
|
</GeometryModel3D>
|
|
</ModelVisual3D.Content>
|
|
</ModelVisual3D>
|
|
</ModelVisual3D.Children>
|
|
<ModelVisual3D.Transform>
|
|
<Transform3DGroup>
|
|
<RotateTransform3D
|
|
CenterX="0"
|
|
CenterY="0"
|
|
CenterZ="0">
|
|
<RotateTransform3D.Rotation>
|
|
<AxisAngleRotation3D Angle="{Binding Rotate_X}" Axis="1,0,0" />
|
|
</RotateTransform3D.Rotation>
|
|
</RotateTransform3D>
|
|
<RotateTransform3D
|
|
CenterX="0"
|
|
CenterY="0"
|
|
CenterZ="0">
|
|
<RotateTransform3D.Rotation>
|
|
<AxisAngleRotation3D Angle="{Binding Rotate_Y}" Axis="0,1,0" />
|
|
</RotateTransform3D.Rotation>
|
|
</RotateTransform3D>
|
|
<RotateTransform3D
|
|
CenterX="0"
|
|
CenterY="0"
|
|
CenterZ="0">
|
|
<RotateTransform3D.Rotation>
|
|
<AxisAngleRotation3D Angle="{Binding Rotate_Z}" Axis="0,0,1" />
|
|
</RotateTransform3D.Rotation>
|
|
</RotateTransform3D>
|
|
<ScaleTransform3D
|
|
CenterX="0"
|
|
CenterY="0"
|
|
CenterZ="0"
|
|
ScaleX="0.8"
|
|
ScaleY="0.6"
|
|
ScaleZ="0.8" />
|
|
</Transform3DGroup>
|
|
</ModelVisual3D.Transform>
|
|
</ModelVisual3D>
|
|
|
|
</Viewport3D.Children>
|
|
</Viewport3D>
|
|
</tool:TrackballDecorator>
|
|
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<Button
|
|
Width="100"
|
|
Height="100"
|
|
Click="Button_Click"
|
|
Content="变化" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|