Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
564 views
in Technique[技术] by (71.8m points)

3d - Wireframe rendering in 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.

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!

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 has a 3D library - does anyone know it's reasonably robust?

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?

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

Edit: 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...