我用Viewport3D
和ModelVisual3D
創建一個帶圖像的簡單ImageBrush(我試過用JPG,PNG),但它顯示圖像模糊,但原始圖像非常尖銳並且清楚。如何在WPF中製作非模糊圖像3d
我不知道如何在3D原有的質量,使它成爲...
我也試着像RenderOptions.BitmapScalingMode
和SnapsToDevicePixels
一些2D解決方案,但在3D情況下,似乎沒有解決這個問題。
有沒有人遇到這個問題或知道解決方案?下面
是示例代碼:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window6" Height="600" Width="600">
<Window.Resources>
<MeshGeometry3D x:Key="Card1" Positions="-0.67,1,0 -0.67,-1,0 0.67,-1,0 0.67,1,0"
TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3" />
</Window.Resources>
<DockPanel Height="600" Width="600">
<Viewport3D Width="415.67" x:Name="viewport" Margin="0,23.363,0,64.363" DockPanel.Dock="Left">
<Viewport3D.Camera>
<PerspectiveCamera x:Name="perCamera" x:Uid="perCamera" FieldOfView="60" Position="0,0,5" />
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup >
<GeometryModel3D Geometry="{StaticResource Card1}">
<GeometryModel3D.Material>
<DiffuseMaterial>
<DiffuseMaterial.Brush>
<ImageBrush ImageSource="images\card.png"/>
</DiffuseMaterial.Brush>
</DiffuseMaterial>
</GeometryModel3D.Material>
</GeometryModel3D>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
<!-- light -->
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="#FFFFFFFF" Direction="0,0,-1"/>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
</DockPanel>
另外一個有趣的帖子可以加強你的評論http://gamedev.stackexchange.com/questions/26187/why-are-textures-always-square-powers-of-two-what-if-they-arent – Andreas 2015-03-02 15:02:29