WPF中的线框渲染 [英] Wireframe rendering in WPF

查看:29
本文介绍了WPF中的线框渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在一个可以做很多事情的大型 WPF 应用程序中编写一个线框 3D 渲染器,但是 WPF 没有执行此操作的本机能力.

I have to write a wireframe 3D renderer in a big WPF app that does many things But WPF has no native ability to do this.

有些人使用 Microsoft 的WPF 3D 工具",特别是它的 ScreenSpaceLines3D 类.但是在网络上有关于该类性能缓慢和各种错误的抱怨,并且该类库似乎自 2007 年以来就没有维护过!

Some people use "3D Tools for WPF" by Microsoft, specifically its ScreenSpaceLines3D class. But on the web there are complaints about slow performance and various bugs with that class, and the class library doesn't seem to have been maintained since 2007!

其他人建议使用 Helix 3D 工具包中的 LinesVisual3D 类,但显然这也有问题(http:///helixtoolkit.codeplex.com/workitem/9957 )

Others have suggested the LinesVisual3D class from the Helix 3D toolkit, but apparently that's buggy, too ( http://helixtoolkit.codeplex.com/workitem/9957 )

Charles Petzold 有一个 3D 库 - 有人知道它相当强大吗?

Charles Petzold has a 3D library - does anyone know it's reasonably robust?

那么我在这里有什么好的选择吗?例如,有没有在 WPF 窗口中执行 OpenGL3D 的好方法?还有其他好的 WPF 库可以可靠地做到这一点吗?

So do I have any good options here? For example, is there a good way to do OpenGL3D in a WPF window? Are there other good WPF libraries that can do this reliably?

提前致谢.

推荐答案

查看 SlimDX.XNA 和 Managed DirectX 等已弃用或过时.可能还检查 SharpDX 我有一段时间没有检查它了.我们将 SlimDX 用于 .NET 中的 DirectX,这很好.您可能正在做的是使用 SlimDX 在 D3DImage 上呈现 WPF 互操作.另一种可能的选择是使用托管的 WinForms 控件并使用它的句柄与 DirectX 和 SlimDX 进行互操作,这可能会更快,但您会失去一些与 WPF 渲染引擎等更容易的互操作.如果您使用 D3DImage,它会变成一个 ImageBrush,您可以设置为任何东西的背景,您不必担心空域问题等

Check out SlimDX. XNA and Managed DirectX etc.. are deprecated or old. Possibly also check SharpDX i haven't checked it in a while. We use SlimDX for DirectX in .NET and it is good. What you are probably looking at doing is using SlimDX to render on a D3DImage for WPF interop. Another possible option is using a hosted WinForms control and using the handle of that to interop with DirectX with SlimDX which might be faster, but you lose some easier interop with WPF's rendering engine etc. If you use the D3DImage it becomes an ImageBrush that you can set as the background of anything and you do not have to worry about airspace issues etc.

哦,是的,由于某种原因,SlimDX 不再有他们的示例下载,但如果您下载它,他们的源代码就有示例.

oh yeah, for some reason SlimDX doesn't have their samples in the download anymore, but their source code has the samples if you download it.

这篇关于WPF中的线框渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆