- Home /
Export objects to a .3DS file at runtime
Hi,
Does anyone know if it's possible to export objects into a .3DS file at runtime (probably) and how ? Is there a library to create such a binary file, or do I have to learn the structure of the 3DS format ?
I'm not talking about a .max, .obj or .fbx mind you, but specifically a .3ds.
(edit) Documentation :
You pbobably need to learn structure of the .3ds format. There is script called ObjExporter whitch exports to .obj format. You can modify it to export to .3ds format or find another library to convert .obj to .3ds.
.3ds seems a lot more complicated than obj though. The point of this would be for the user to download a scene at runtime, so I wouldn't have the opportunity to convert it.
Answer by Macro · Mar 13, 2014 at 10:09 AM
I doubt there is anything that will do this as you would need to be able to go from a Unity Mesh to 3ds file, which is far from impossible but is gonna be time consuming.
I remember writing a 3ds importer/exporter in C++ a while back and it was based upon the information here:
http://www.mediatel.lu/workshop/graphic/3D_fileformat/h_3ds.html
So you can basically just loop over a mesh extracting all its polygon data and then dump it into the formats described in there along with any other information you want in your exported file.
Yes, it looks like I'll have to roll up my sleeves and do it myself. I'm currently writing the importer with xbdev doc and the one you linked. Once import is done, export won't be too hard.
Right now I am struggling with normals. I might have to reconstruct them from smoothing groups, which will be a pain :/
If you do write a reliable way to export a mesh to 3ds you may as well add some simple editor elements on it and whack it on the asset store.