gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > 3ds loading tutorial

#115280 - Xgame - Sun Jan 14, 2007 4:43 pm

Hi to evryone; i'am looking for a 3ds loading tutorial, wich include textcoords and colors. for give an idea, this:http://tfc.duke.free.fr/coding/md2-specs-en.html , but about 3ds. thank you!

#115281 - simonjhall - Sun Jan 14, 2007 4:55 pm

I wrote a 3D Studio Max file loader a number of years ago, and I think this is the doc that I used:
http://www.martinreddy.net/gfx/3d/3DS.spec
Dunno if the file format has changed (drastically) since then.

Basically it's organised into a hierarchy of chunks, where each chunk stores a different type of thing.

Before writing the loader I wrote a script in Max to allow me to export the data as text - you could always try doing that instead as parsing the 3DS file format isn't something you can do in half an hour :-)

Good luck!
_________________
Big thanks to everyone who donated for Quake2

#115309 - Payk - Sun Jan 14, 2007 11:01 pm

Yes a maxscript could be betterway.
Why not in a xml format?!!?!
You could then use tinyxml to read out values.

I am not quite shure which animation type 3ds has, but if it is boneanimation, i wouldnt use it for nds.

Yes sure, boneanimation is looking nice. But with milkshape for example, you can export to md2. It does then animate it using bones, and captures vertex postions in order to write keyframe animations. Thats why i choosed md2. But it has disadvantages.

MD2 doesnt have groups, which could be used for giving certain parts of a model a different polyID (e.g. to have a face with outlineborder like [Images not permitted - Click here to view it])

Another problem is the UV coords in animation. They cant be changed during frames. So it simply wont be possible to get a smile on a model in certain frames and in other not.

But md2 is still the fastest and easiest way to go.

#115316 - APL - Sun Jan 14, 2007 11:58 pm

If you're not looking for animations then you might look at the wavefront obj format. It's not efficient at all, but it's very easy to parse. Perhaps you could parse it ahead of time into whatever form your game needs.
_________________
-Andy L
http://www.depthchasers.com

#115346 - kusma - Mon Jan 15, 2007 12:18 pm

Or you could look at Collada, a 3d-format designed for data-interchange between modeling-packages and/or game tool chains. Personally, I use a set of home-made max plug-ins, partly because they allow me to do more than just grabbing the data and partly because Collada didn't exist back when I set up my content pipeline ;). Plug-ins isn't that hard either. I found writing exporters easier and more effective than writing loaders.

#115359 - Xgame - Mon Jan 15, 2007 3:49 pm

thanks to evryone; I don't need animatin(for those I coded an md2 viewer). I think 3ds is a good support, but if it isn't, I'll change support. So is better a maxscript or an other model type?

#115360 - Payk - Mon Jan 15, 2007 3:53 pm

Yes, if you really want extra features in your model , an exporter is essencial. I am really playing with that thought to do that. But i am not sure for which app. Milkshape is cheapest one, but not that professional.
Maya and 3ds are that incredible expensive :(
I should take a look at alternatives...

#115361 - ikaris - Mon Jan 15, 2007 4:04 pm

I know it's not 3ds max, byt you can use my Maya exporter...

It exports a CallList to a .h file.

It supports vertex position, texture coordinates, vertex colors and normals, tested to work accurately with lighting.

http://www.vurtx.com/tools.htm

http://www.vurtx.com/tools/dlDSDisplayListExporter.zip

#115362 - kusma - Mon Jan 15, 2007 4:05 pm

Payk wrote:
But i am not sure for which app. Milkshape is cheapest one, but not that professional.
Maya and 3ds are that incredible expensive :(
I should take a look at alternatives...


Softimage XSI is cheap-ish (~500e) and still a quite a capable modeling package.

#115374 - Xgame - Mon Jan 15, 2007 6:21 pm

I know gmax is free. it should be a reducted version of 3dstudio http://usa.autodesk.com/adsk/servlet/index?id=5562445&siteID=123112