Jump to content

  • Log In with Google      Sign In   
  • Create Account


.3DS Animation - Pos Rot and Scale tracks structure


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 01 March 2013 - 06:56 AM

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, 01 March 2013 - 07:16 AM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6885

Like
-1Likes
Like

Posted 01 March 2013 - 07:05 AM

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) ?



#3 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 01 March 2013 - 07:06 AM

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, 01 March 2013 - 07:11 AM.


#4 Ashaman73   Crossbones+   -  Reputation: 6885

Like
0Likes
Like

Posted 01 March 2013 - 07:16 AM

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



#5 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 01 March 2013 - 07:20 AM

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.



#6 Sik_the_hedgehog   Crossbones+   -  Reputation: 1543

Like
2Likes
Like

Posted 01 March 2013 - 09:09 AM

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.


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#7 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 02 March 2013 - 08:49 AM

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 :)



#8 Sik_the_hedgehog   Crossbones+   -  Reputation: 1543

Like
0Likes
Like

Posted 02 March 2013 - 09:15 AM

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 =)


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#9 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 02 March 2013 - 10:38 AM

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, 02 March 2013 - 10:39 AM.


#10 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 04 March 2013 - 05:51 AM

Just noticed that in the example code given in this link, the code I'm chasing has been commented out, and no reason why is given.

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

 

:(

 

If anyone knows of any other examples please let me know



#11 Sik_the_hedgehog   Crossbones+   -  Reputation: 1543

Like
0Likes
Like

Posted 04 March 2013 - 01:16 PM

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.


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#12 bwebster890   Members   -  Reputation: 186

Like
1Likes
Like

Posted 04 March 2013 - 03:52 PM

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, 04 March 2013 - 03:55 PM.


#13 mynameisnafe   Members   -  Reputation: 252

Like
0Likes
Like

Posted 04 March 2013 - 07:29 PM

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 :)



#14 bwebster890   Members   -  Reputation: 186

Like
1Likes
Like

Posted 04 March 2013 - 10:02 PM

yeah, no problem, I actually didn't know either till I looked at their webpage again






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS