在 WPF 中禁用面部剔除
我开始尝试 WPF 3D 渲染,我面临的第一个问题是如何禁用面部剔除。 我知道如何在 DirectX 和 OpenGL 中执行此操作,但我找不到在 WPF 中执行此操作的方法。 这是我的 ViewPort 标记。该模型是在运行时生成的,它是 GeometryModel3D 内的 MeshGeometry3D
<Viewport3D x:Name="viewport" DockPanel.Dock="Right" Margin="0" >
<Viewport3D.Camera>
<PerspectiveCamera x:Name="camera" FarPlaneDistance="50" LookDirection="0,0,-10"
UpDirection="0,1,0" NearPlaneDistance="0" Position="0,0,5"
FieldOfView="45" />
</Viewport3D.Camera>
<ModelVisual3D x:Name="model">
<ModelVisual3D.Content>
<Model3DGroup x:Name="group">
<AmbientLight Color="DarkGray" />
<DirectionalLight Color="White" Direction="-5,-5,-7" />
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
非常感谢您给我的任何建议。
I'm starting experimenting with WPF 3D rendering, and one of the first problems I'm facing, is how to disable face culling.
I know how to do that in DirectX and OpenGL, but I can't find a way to do that in WPF.
Here is my ViewPort markup. The model is generated at runtime, and it's a MeshGeometry3D inside a GeometryModel3D
<Viewport3D x:Name="viewport" DockPanel.Dock="Right" Margin="0" >
<Viewport3D.Camera>
<PerspectiveCamera x:Name="camera" FarPlaneDistance="50" LookDirection="0,0,-10"
UpDirection="0,1,0" NearPlaneDistance="0" Position="0,0,5"
FieldOfView="45" />
</Viewport3D.Camera>
<ModelVisual3D x:Name="model">
<ModelVisual3D.Content>
<Model3DGroup x:Name="group">
<AmbientLight Color="DarkGray" />
<DirectionalLight Color="White" Direction="-5,-5,-7" />
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
Thanks very much for any suggestion you could give me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知不能,但你可以给背面也提供一种材料。
问候, 杰伦
as far as i know it cannot, but you can give the backside also a material.
Regards, Jeroen