3d Studio Max SDK for C#

Started by
3 comments, last by Ashandir 20 years, 3 months ago
I am trying to do some DX stuff in C# and I am good at 3ds max. I want to make some way to import my scenes into C# code with DX 9.0. I was wondering if anyone had some sample code or anywhere I could read more about the 3ds max SDK. I am kind of a newb so I would really like some tutorial or good noted source code. Thank You in advance
Advertisement
I don't believe there are any managed extensions to the 3ds max SDK. You could write a wrapper to interface with your managed code, but that would get unecessarily complex really quickly.

I think your best bet is to just use known exporters to export your 3ds max data to a file, then import that file into your C# code. If you search the web you should be able to find something.

The DirectX SDK comes with an exporter for the .x file format. I'm sure you can find sample code on the web on how to import this format in C#. Also, Tom Miller's book, "Managed DirectX 9 Kick Start : Graphics and Game Programming" has a full chapter on using .x file format in C#, including how to do animated meshes and it includes full source code on the CD.

You can get the book here.



[edited by - Alias2 on January 6, 2004 2:36:29 PM]
I am currently on page 75 of the book right now. It is open on my desk. Just was wondering if that was the best way to doit with the dx sdk built in converter to .x or if a wrapper would give you better results. Let me know what ya think
The answer to that question is specific to your particular program.

The wrapper I was mentioning was a way to use the 3ds max SDK from managed code. I think this is over-kill. If you are going to write an exporter for 3ds max, then you should use native code. At least until Discreet provides their own managed API for their SDK.

The question on whether or not to write your own exporter or use one of the popular file formats (i.e. .x file format) is different and depends on your project. If you need your data stored in a specified way (or something persisted that is not saved with the .x file exporter), then by all means write your own exporter, file format, and import into your game.

However, for most individual projects, I''ve found that the existing file formats are more than satisfactory. You will save a ton of time using something like the .x file format (or whichever one suites your needs), because it is a well established and proven file format. Plus, there is plenty of sample code (both managed and un-managed) for using these. That book is the best reference I''ve seen for managed code, though.

Mesh.FromFile() typically does a decent job of loading a mesh exported out of 3dsmax into C#.

Microsoft provides a x file exporter for 3dsmax, although it had some problems (weird handling of scale, and didn''t support the ISkin interface); I updated the Microsoft code and put the new exporter up at:

http://www.b500.com/~hplus/graphics/xskinexp.html
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement