My designers are supplying me 3ds files all the time. But I am not sure how to read those files from my programming code. Is there a way to convert those files to XML files or some other open format? Or better is there a way to export from 3D Studio Max to some open format?
s03, I figured there would be somebody here that knew the answer, since it is an unavoidable problem. (Also it could have been possible that opengl supported some format, like directx supports .x files.)
Thank you for your help twxs. I really appreciate it!
For open file format, I suggest you use COLLADA. It is done by khronos group. Also, look into FBX SDK provided by AutoDesk, it supports few popular file formats including 3ds and COLLADA. 3Ds is very widely used format and COLLADA is open standard format. FBX is free and platform independent.
Or better is there a way to export from 3D Studio Max to some open format?
You can write a custom exporter and save in any format you like. Visit their website and look for the developer tools/SDKs.
Collada defines a base schema that facilitates asset transport in complex tool chains, like those used in OpenGL|ES PS3 development, though it could be used for anything you like. Khronos has it’s own website and forum for this stuff.
OpenGL itself provides no file formats of any kind.
Collada sounds like a great format but I figured it is probably a bit too advanced for what I want to do. After all, the point is that I have to write some code to read those files.
Seems like X3D has a lot of crazy properties too and I don’t like the structure that much at all. But not to lose much more time I started to write X3D support. But the more I worked on it the more I realized how confusing the structure of this format is.
I was actually looking for something simple that looks more like:
OBJECT name=“this is a car”>
SHAPE name=“this is a couple of lines”>
POINT x=“2” y=“5” z=“10”/>
POINT x=“10” y=“1” z=“2”/>
POINT x=“1” y=“4” z=“3”/>
…some more polygons
…some more shapes
So now I am going to throw out that X3D stuff and going to look up some information to write an exporter for 3D Studio Max. Hopefully this can be written in C#. Allthough I guess it will be in C++ again. It’s a C++ world we are living in .
I would suggest against VRML. Sometimes, the conversion isn’t correct, sometimes there are some differences… you almost NEVER get back what you put in.
I did some tests with VRML (not sure of the version) two years ago and it didn’t cut it for me. If you’re lucky it may do the job. Good for you.
Consider however COLLADA is the final solution. If you get it working (at least sufficiently well) you’ll never have this issue again. Wow!
PS: remember it’s an exchange format, do not use it for final assets, this would suck so badly!