We are planning to implement a interactive 3D model editor in c#.net.
This editor should allow the user to draw different type of graphical
elements like line, triangle, circle ,rectangle and do some operations
like translation, scaling and rotation etc. Similar to UML editor.
Regarding this, can someone share your experience and thebest
technology which suits the above requirement with ease to develop and
performance oriented.
My options are
1. GDI+
Highly not recommended. For one thing, it's purely 2D, so you'll need
to do any 3D stuff yourself. With more or less complicated models
you'll need Z-buffering anyway, and that means you'll have to roll out
all the primitives yourself - the only thing you'll get from GDI+ in
that case is the pixel buffer...
Second problem with it is that it's slow. It doesn't use GDI
primitives, and most graphics cards accelerate those. In theory, a GDI
+-accelerating card could be made, but I do not know of any.
Finally, GDI+ is effectively deprecated. It's not being developed any
further, and rumor is that the GDI+ team was in fact disbanded a long
time ago. There are some known bugs there that have been there for
ages and aren't fixed yet, and probably never won't.
The "official" 3D API on Windows. Pretty clean these days, though
personally I still prefer OpenGL as far as APIs go. Microsoft had .NET
bindings a while ago, but those are no longer supported (in favor of
XNA), so you have to use third-party ones. Still, a reasonable default
choice for non-cross-platform 3D Windows applications of any sort.
Okayish. Bindings are available (e.g. Tao). Relatively clean API; from
your description of what you want to do, you'll really mostly need the
basics. All available .NET bindings are third-party, if you care about
that sort of thing. Also, as far as I know, in Vista and above, OpenGL
isn't quite as well supported by the drivers (not sure if that's still
true in general, but at least I still get switches to Basic theme when
running some OGL apps). It is probably why Autodesk had added D3D
support in the most recent AutoCAD release for Windows.
Please provide if there is some other best technology forthis
purpose apart from the above options.
Yes; it's WPF. Have a look at System.Windows.Media.Media3D namespace
(
http://msdn.microsoft.com/en-us/library/
system.windows.media.media3d.aspx). You get all the high-level 3D
primitives and easy hit testing, which sounds like exactly what's
needed in your case; and, of course, if you do the rest of the UI in
WPF, it all works seamlessly together. All in all, for a managed 3D
application that's not a game, it looks like the best deal. I don't
know about performance of that thing, though - never tried it with
anything beyond "hello world" type of things; but it's based on D3D
under the hood, so it shouldn't be that bad. Still, definitely
something to test first if you are going to consider it.