WPF 实现 3D足球效果,效果图如下: 每个面加载不同贴图。
<UserControl x:Class="MediaBalll.Model3Ds.BuckyBall"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tools="clr-namespace:_3DTools;assembly=3DTools"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" Width="900" Height="600">
<Grid Background="#FF767272">
<tools:TrackballDecorator>
<Viewport3D ClipToBounds="True" >
<Viewport3D.Camera>
<PerspectiveCamera x:Name="camera" Position="0,0,6" LookDirection="0,0,-1" FieldOfView="90" >
<PerspectiveCamera.Transform>
<Transform3DGroup>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D x:Name="cameraAngel" Axis="0,1,0" Angle="0"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
<ScaleTransform3D x:Name="cameraScale"/>
<TranslateTransform3D x:Name="cameraTrans"/>
</Transform3DGroup>
</PerspectiveCamera.Transform>
</PerspectiveCamera>
</Viewport3D.Camera>
<ContainerUIElement3D x:Name="container3DElement"/>
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup>
<AmbientLight Color="White"></AmbientLight>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
</tools:TrackballDecorator>
</Grid>
</UserControl>
源码下载: http://download.csdn.net/detail/u013224722/9611746 实在抱歉,赚点积分!