在flash10中,qazxsw poi可以轻松地在3D空间中围绕其中心旋转图像。
我的flash10示例是在[I can http://jsc.sourceforge.net/examples/web/MatrixStuffExample/Application.htm (来源:)
我想将此示例移植到WPF。
有没有一个例子如何在没有XAML的情况下在C#中的WPF中进行这样的3D转换?
在silverlight 3中,您将使用Matrix3DProjection。你将如何在WPF中实现?
我已经设置了一个基本的薄立方体并将其旋转,以便您可以通过C#查看变换的工作原理。
在xaml中设置您的视口
sourceforge.net
而继承人背后的代码,转型是最后一种方法...希望这有帮助......如果你想了解更多信息,请给我一个大喊!
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<StackPanel>
<Viewport3D Name="mainViewport" ClipToBounds="True" HorizontalAlignment="Stretch" Height="300">
<Viewport3D.Camera>
<PerspectiveCamera
LookDirection="0,0,-20"
UpDirection="0,1,0"
Position="0,0,50"
/>
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup x:Name="group3d">
<SpotLight Position="10,10,10" x:Name="mySpotLight" Color="Yellow" InnerConeAngle="15" OuterConeAngle="100" Range="100" />
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
</StackPanel>
</Window>