views:

1030

answers:

6

Which is the preferred approach for doing .NET 3D graphics programming: Direct3D or XNA seem to be the current technologies, but which is best for non-game related programming?

Also, has Managed Direct 3D been discontinued? XNA doesn't really seem to be appropriate for non-game development.

A: 

I'm not in anyway an expert but when I messed around with both I found XNA way better. I just goof around with my Zune and PC gaming. I didn't have enough time to mess with DirectX and I found way more examples for XNA.

You also have a whole community to help you.

Bobby Cannon
+2  A: 

If it's not game related what is it about? If you answer this we might give you a good answer, anyway depending on the application WPF might be a good answer.

Pop Catalin
True... I didn't pick up on the "non-game" related part...
Bobby Cannon
I think WPF in this context is currently not an option. WPF have some 3D support but is imo not (yet) a 3D framework that can be compared to either Direct3D, Managed DirectX or XNA.
Peter Lillevold
@Peter Lillevold: WPF is not a 3D framework, It's a UI framework with full 3D support, you can integrate XNA or DirectiX in a WPF application or simply use WPF for 3D ... http://www.youtube.com/watch?v=SgNPHldOEZA, WPF gives you full access to pixel and vertex shaders ...
Pop Catalin
also, for 3D applications WPF is a adequate framework. I'm not saying it will ever compete with DirectX or XNA for "game" development, but the question was about "non game" development. Check out some cool demos and videos for WPF 3D here: http://www.interknowlogy.com/lab/Pages/Network.aspx
Pop Catalin
This is a terrible non-answer to the question. The answer below mentioning SlimDX is much more informative.
Baxissimo
+4  A: 

Yap, too bad MS discontinued MDX. I'm currently using SlimDX for our non-game development. It's not a drop-in replacement for MDX, but at least the API design is quite intuitive compare to MDX v1.1's API. I've used MDX v1.1 + .Net v1.1 for version 1 of our product. As for version 2, we're migrating over to .Net 2.0. MDX v1.1 doesn't works well with .Net 2.0, plus it has quite a bit of other inherent problem. Thus we had to scout for alternative.

Initially XNA was our best choice. Then, because it target gaming market and compatibility with xbox 360, we found that we need to write a lot of workaround/hacks to make it works for us. The worse is interoperability with DirectShow, which we use extensively in our product. MS created a huge gap in between existing and the new technology, where the latest replacement for MDX and DirectShow is not powerful enough to replace the old ones at the moment, and we can't afford wait for the next version.

I wouldn't say SlimDX is the best for non-gaming development. But for my case, it is. And since it's OpenSource, we can always make changes to places where we see fit. There exist quite a will glitches when we use SlimxDX + DirectShow.Net. These glitches doesn't exist when we're using MDX 1.1 + DirectShow.Net. My guess is, internally, MS put in quite a bit of hacks to make it work.

Anyway, if you're not using DirectShow at all, do consider Ogre3D/MOgre3D. MOgre3D is a manged wrapper for Ogre3D, a well built 3D engine. It was our first choice, but we can't use it because it doesn't support DirectShow well.

faulty
A: 

Xna is Microsoft's Managed DirectX. Unfortunately they haven't written much about using it for non game related things but it can be done.

Unfortunately I can't find any good resources online that show how to do this right now.

smack0007
+3  A: 

Managed DirectX wasn't so much abandoned as it was rewritten as XNA. True, XNA was designed with the Xbox 360 in mind, but XNA is as appropriate to use for non-game 3D programming as is any other 3D framework I've used. Don't overlook XNA's enormously convenient content importing pipeline... You can get your models and shaders onto the card and rendering with great ease.

As stated above, the Creaters Club community is very rich, and their Winforms tutorials will likely be of interest to you.

bojolais
A: 

The simple answer here is maybe XNA. And maybe WPF. It depends.

If you're looking for anything that's remotely gamelike, XNA is a really good solution, as it gives you an framework that meshes very well with just about any implementation of a 3d interactive world. In addition to handling all of the 3d visual stuff, you get things like collision detection, lighting, timing, and cameras that all hook in very easily. If what you're working on is some kind of 3d virtual space, what you have is probably pretty close to being a game anyway and XNA will give you a lot more besides just the graphics end.

Otherwise, if you're looking for 3d UI or data visualization, WPF is probably more of what you want. There's less unnecessary overhead and the other things you get included like commanding or data binding are probably going to be more useful to you anyway. As I understand it, it's set to use hardware acceleration on the backend and will handle material shaders and various 3d effects through software if necessary so that the user gets a visually consistent experience.

If you've got an example that doesn't really fit well into either of these camps, I'd really be interested in hearing about it. Could be a good opportunity for someone who wanted to write a useful graphics library...

Raumornie