Drawing 3D lines in WPF

删除回忆录丶 提交于 2019-11-30 05:17:58

WPF does do 3D, and it does it well.

You'll need to use the Viewport3D class to create 3D.

As of WPF 3.5 SP1, you can compose DirectX and WPF so that you can do fairly sophisticated 3D applications.

I seem to remember 3D Tools for WPF working rather well a few years back. I haven't worked on anything 3D in WPF for a long time now, so it's possible other libraries have surpassed this, but I can't say for sure.

If you aren't interested in working with that, you may also consider trying XNA inside of WPF. This way you'll keep your managed environment (as XNA has replaced managed DirectX). Here's an article about doing this, though I haven't actually tried it.

Just adding to this that OpenTK, which is a wrapper around OpenGL, is usable as well from a WPF application, there is a simple example that's easy to get up and running on the OpenTK site:

http://www.opentk.com/doc/chapter/2/glcontrol

3DTools library in fact is bad solution. It is not simply my opinion. For example, test it by adding to scene 100-150 objects from 3DTools library and try to rotate the scene. It is the answer concerning 3D Tools. If you wish fast performance in WPF 3D you must build own meshes. It is not complicated task as you are 3D CAD developer. And also if your task is concerning approx 1000-5000 simple 3D objects within scene use WPF 3D, no problem. If more (or very complex): XNA, NET Wrappers of DirectX or OpenGL.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!