• Advertisement
Sign in to follow this  

.3DS Animation - Pos Rot and Scale tracks structure

This topic is 1783 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

Hi,

 

I need some/one people/person who have written .3ds loaders which pull animation data out using any language I don't care which it's irrelevant.

 

What I need to know is how the 0xB021 position track, 0xB022 rotation track, and 0xB023 scale track are structured so that I can write this section of my loader. It's kind of the important bit. I have everything I need bar this information.

 

I also need this information desperately. I've been asking everywhere and no-one ever seems to reply, let alone point me at some documentation, a working loader*, etc.

 

I know it's pretty much a dead format, but it's a uni project and .3ds is set in stone.

 

*lib3ds - yeh great but it's a mass of horrible looking code, and I can't find the bit that deals with these chunks specifically - if you know where to point me in lib3ds, please do so, it would be massively appreciated.

 

Praying for help now.

 

Thanks in advance

Edited by mynameisnafe

Share this post


Link to post
Share on other sites
Advertisement

I know it's pretty much a dead format

is the reason for

no-one ever seems to reply

 

.3ds is set in stone.

How about converters to more suitable formats (fbx,collada) ?

Share this post


Link to post
Share on other sites

it's a uni project and .3ds is set in stone.

 

I'd love to write the curriculum but I don't. Sorry dude.

 

Also nevermind discussion on SDK reliance, and Collada's not a great idea - it's a 'game' so I'm looking for a quick load.

Look in the future I'll use FBX I promise, but to be fair the only problem with .3ds is the documentation, other than that it's a great format imo.

Edited by mynameisnafe

Share this post


Link to post
Share on other sites

Also nevermind discussion on SDK reliance, and Collada's not a great idea - it's a 'game' so I'm looking for a quick load.

There are other ways...

 

-1 for a valid sugguestion

 

&

 

f****** pronto

 

is most likey an other reason for

 

no-one ever seems to reply

Share this post


Link to post
Share on other sites

Look, I'm not really looking for an argument here.

 

Given - poor language - and edited. Apologies. Just stress creeping in.

 

I'm sorry though, I can't use any other format: it's a university project and the title of the project is "Loading a .3DS File using C++". So it's not really a valid suggestion to solve my problem.

Share this post


Link to post
Share on other sites

Another reason would be that finding information really isn't hard... I searched "3DS chunk 0xB021" and already got lots of information on the format in the first page, including the relevant chunks.

 

The only one with which you may have issues understanding is with rotation (translation and scaling seem pretty trivial). If you know how glRotate used to work then you probably can get the idea of how the angle is stored.

Share this post


Link to post
Share on other sites

Google hits 1-4 use van Velsen documentation which acknowledges but doesn't process these chunks. Hit 5 is this thread, hit 6 is a Gamedev thread no-one got back to on the subject.

 

Okay 7 is good! I see how rotation works and that's epic - just like you say it did ( I see it's not a quat )!

 

Google hit 8 is lib3ds*, and 9 doesn't touch these chunks, a la van Velsen :/

 

10 looks good (a library I hadn't seen) but I can't find any source, I will have a hunt on their site.

 

Lib3ds has all the answers but is typedef'd beyond all recognition and I don't understand what's going on in the bits of it that do things that I haven't done in my own loader. I'd love to scour the lovely GPL/LGPL Lib3ds for knowledge but it's just so.. Lib3DS-y.

 

I suppose I've been blindsided by just looking for complete documentation as opposed to scouring forums for info on a given chunk, but fairplay.

 

You know dude, I've got 19 days to go on this project and I've barely prepped the gfx/render pipeline for animation 'cos I've been doing this loader so long, but what you gave me might save my bacon - I can see how rotation_track is done and if I apply that to the other chunks, with a bit more reseacrh I'm onto a winner. (Google hit 7 - That rotation code on the forum is a perfect help). +1 :)

Share this post


Link to post
Share on other sites

Google hits 1-4 use van Velsen documentation which acknowledges but doesn't process these chunks. Hit 5 is this thread, hit 6 is a Gamedev thread no-one got back to on the subject.

Weird, hits 2 and 3 for me were the 3DS format documentation (although I admit having to use Ctrl+F to find the chunks, the documents are so huge that it's extremely easy to miss them). Maybe it gave you different results though. Also I mentioned how rotation works because neither document seemed to explain it (one post in another of the hits explained it instead).

 

Good that was enough though =)

Share this post


Link to post
Share on other sites

Google hits 1-4 use van Velsen documentation which acknowledges but doesn't process these chunks. Hit 5 is this thread, hit 6 is a Gamedev thread no-one got back to on the subject.

Weird, hits 2 and 3 for me were the 3DS format documentation (although I admit having to use Ctrl+F to find the chunks, the documents are so huge that it's extremely easy to miss them). Maybe it gave you different results though. Also I mentioned how rotation works because neither document seemed to explain it (one post in another of the hits explained it instead).

 

Good that was enough though =)

 

Well it's just that now I know that these chunks contain what isn't subchunks, + this link was in one of the ones from that let me google that for you search:

 

http://away3d.googlecode.com/svn/trunk/fp10/Away3DLite/src/away3dlite/loaders/Max3DS.as

And that's a friggin beast of a find, so I thank you sir! smile.png

 

Edit: and the rotate info too :)

Edited by mynameisnafe

Share this post


Link to post
Share on other sites

The data of the three chunks seems to match how OpenGL does it (0xB020 is the translation in the X/Y/Z axes, 0xB021 is the rotation which I already explained, 0xB022 is the scaling in the X/Y/Z axes), there isn't much more to it, really (translation and scaling should be pretty easy to figure out). The only issue is that I don't know in what order they're made... but even then there are only six possible combinations, so in the worst case you could just try them all and you'll eventually hit the correct one.

 

There's also the issue of interpolation between keyframes. For translation and scaling I assume it's just interpolation as-is, for rotation I suppose you'll need to normalize the axis (the 2nd to 4th floats) before applying the rotation. Guessing here, never worked with the format.

Share this post


Link to post
Share on other sites

I don't know if you want to write this all yourself or not, but you could look at Assimp to get some ideas

 

assimp loads lots of 3D file types and they make it easy to extract 3D animation data. Assimp is written for a few languages and they have the source code available for download

Edited by bwebster890

Share this post


Link to post
Share on other sites

I don't know if you want to write this all yourself or not, but you could look at Assimp to get some ideas

 

assimp loads lots of 3D file types and they make it easy to extract 3D animation data. Assimp is written for a few languages and they have the source code available for download

 

Didn't know that was open source, sweet idea I shall check it out, thank you :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement