Archived

This topic is now archived and is closed to further replies.

3d Studio Max SDK for C#

This topic is 5091 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites