Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

andy_fish

file formats for animation?

This topic is 5396 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 guys, I''m about to start writing code to load 3d models into my game. But I''m not sure which format to use, because I don''t know a lot about how animation is stored in a file. So, do all 3d files store animations with the models? And are animations usually skeleton-based? And is the animation usually saved as keyframes or as frame-by-frame data? And is there anything tricky I have to do if I want to use one animation for several models? And I guess the money question is, which file format would you recommend? Thanks for your expertise, Andy

Share this post


Link to post
Share on other sites
Advertisement
>>So, do all 3d files store animations with the models?<<
No not all 3D file formats store animation data.

>>And is the animation usually saved as keyframes or as frame-by-frame data?<<
I doubt you find any with frame-by-frame animation. The reason being is the memory required to store every frame. Instead they use keyframes then use some kind of frame interpolation to blend in between the keyframes.

>>And is there anything tricky I have to do if I want to use one animation for several models?<<
If there from the same type (IE Quake 3 models) they all (I believe) use the same animation data, just modeled different.

Heres what I mean:
Heres the animation data for the Lara model (Quake 3)

0 31 0 25 // BOTH_DEATH1

31 1 1 25 // BOTH_DEAD1

32 35 0 20 // BOTH_DEATH2

67 1 1 20 // BOTH_DEAD2

68 25 0 25 // BOTH_DEATH3

93 1 1 25 // BOTH_DEAD3


94 39 0 15 // TORSO_GESTURE

133 7 0 15 // TORSO_ATTACK

140 11 0 15 // TORSO_ATTACK2

151 5 0 15 // TORSO_DROP

156 6 0 15 // TORSO_RAISE

162 31 0 10 // TORSO_STAND

193 11 0 10 // TORSO_STAND2


94 12 12 15 // LEGS_WALKCR

107 12 12 15 // LEGS_WALK

120 12 12 17 // LEGS_RUN

133 12 12 17 // LEGS_BACK

146 12 12 14 // LEGS_SWIM

159 6 0 8 // LEGS_JUMP

167 6 0 12 // LEGS_LAND

172 6 0 10 // LEGS_JUMPB

178 6 0 10 // LEGS_LANDB

185 6 6 5 // LEGS_IDLE

192 6 6 5 // LEGS_IDLECR

199 6 6 20 // LEGS_TURN



And heres Binky:

1 29 0 20 // BOTH_DEATH1

29 1 0 20 // BOTH_DEAD1

30 18 0 20 // BOTH_DEATH2

47 1 0 20 // BOTH_DEAD2

48 22 0 20 // BOTH_DEATH3

69 1 0 20 // BOTH_DEAD3


70 40 0 20 // TORSO_GESTURE


110 5 0 15 // TORSO_ATTACK (MUST NOT CHANGE -- hand animation is synced to this)

116 6 0 15 // TORSO_ATTACK2 (MUST NOT CHANGE -- hand animation is synced to this)


122 5 0 20 // TORSO_DROP (MUST NOT CHANGE -- hand animation is synced to this)

127 4 0 20 // TORSO_RAISE (MUST NOT CHANGE -- hand animation is synced to this)


131 1 0 10 // TORSO_STAND

116 1 0 15 // TORSO_STAND2


133 16 16 23 // LEGS_WALKCR

149 17 17 23 // LEGS_WALK

166 10 10 17 // LEGS_RUN

176 9 9 15 // LEGS_BACK

186 10 10 15 // LEGS_SWIM


196 10 0 17 // LEGS_JUMP

206 10 0 18 // LEGS_LAND


216 12 0 22 // LEGS_JUMPB

228 3 0 18 // LEGS_LANDB


231 12 12 10 // LEGS_IDLE

244 10 10 10 // LEGS_IDLECR


149 17 17 15 // LEGS_TURN



As you can see, they all usually use similar animation sequences.

>>And I guess the money question is, which file format would you recommend?<<
Good question. I like .3ds, .md2, .md3, and .mdl. Milk shape isn''t that bad, it does bone animation i think. I don''t know, there all good. Just find one you like and go with it.

Good luck!

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I have more question for character animation .
I want to create program for show 3d character animation and user can change equipment .

How to change equipment (armor hat ...) in directx programming?
Or word for search in internet.
Thank you

Share this post


Link to post
Share on other sites
If your 3D character and his ''items'' (hat, gun etc) are all part of one model then you pretty much have to load a whole new model to change any detail. On the other hand, your character could be made up of ''chunks'' and tags like the .md3 (Quake 3) model. The .md3 player model is actually multiple models (head, torso, legs) with vector tags that indicate where the gun models (separate models) attach and aim from. You could define a custom model type for your character and add more vector tags to your custom .md3. These tags would indicate where a cloak or hat or whatever would attach. You can use the same principle with .x file templates or come up with your own custom format. Best way is probably to learn all about an established format like .md2 or .md3 first.

Share this post


Link to post
Share on other sites
quote:
Original post by UltimaX
>>And is the animation usually saved as keyframes or as frame-by-frame data?<<
I doubt you find any with frame-by-frame animation. The reason being is the memory required to store every frame. Instead they use keyframes then use some kind of frame interpolation to blend in between the keyframes.



Explain real slow what you are thinking is the difference between frame by frame and keyframe - when I hear keyframe I'm thinking "This frame for 1 frame, blend(interpolate) for 30 frames til the next frame" and so on, which is fine, that's how you'd block out a sequence, afaik. BUT, this is essentially the same as what I think of as 'frame by frame', except that with 'frame by frame' the frames are evenly spaced out (but in either schema you'd want to interpolate, afaik.) The way I'm plotting to handle frame by frame is to construct a timetable from either frame by frame or keyframe and set timers, bells, and whistles accordingly. My thoughts on the subject are almost certainly incomplete or incoherent, but you've piqued my curiousity, and I'm interested in hearring an extension to the above comment.

I'm currently working on an animation playback/creation program for the .glm / .gla file format, used in Jedi Knight 2, Soldier of Fortune 2, and soon Jedi Knight: Jedi Academy.

[edited by - wudan on August 18, 2003 3:27:07 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!