Drawing 3D lines in WPF

Ram picture Ram · Jan 21, 2010 · Viewed 13.9k times · Source

I am working on a CAD application and thinking of using WPF for rendering my entities.

But it seems like WPF doesn't support drawing 3D lines. Is there any ways for drawing 3D lines in WPF?

I don't 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 DirectX 9 or 10? Can I mix DirectX in WPF? I mean some way of interop?

Many Thanks

Answer

codekaizen picture codekaizen · Jan 21, 2010

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.