I am working on a CAD application and thinking of using WPF for rendering my entities.
But it seems like WPF doesnt support drawing 3D lines. Is there any ways for drawing 3D lines in WPF? I dont like to create a mesh for each line entity I need to draw as I am afraid, this would cause a major performance hitch for me as I would have to create number of line entities in my application.
If this is not possible through WPF, will it be possible to do this in DriectX 9 or 10? Can I mix directX in WPF? I mean some way of interops?
Many Thanks,
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.