Advertisement

Skeletal Animation Question

Started by November 26, 2003 04:09 PM
5 comments, last by BDePesa 21 years, 3 months ago
I've looked at Brett's ms3d skeletal animation tutorial at rsn.gamedev.net. Though it took a few weeks, I've got the gist of it down, and I'm happy to say that basic animations and such work. However, I would like to switch between several animations within one ms3d file, by jumping to a certain frame, and then playing until a certain frame. I've got the number of frames, and I've gotten the animation to stop at a certain frame, but I have yet to get it to start at a certain frame. I've been working on this for several days now, and it's really starting to tick me off. Any suggestions would be most kind . *Edit* I've gotten it working :-D I just passed the min and max frames to the draw function, which now passes them to the animation function, in which I set the loop to set the timer to the minimum frame, and if its past the maximum frame to reset to the minimum frame... if anyone needs to see the code, drop me a line at CcSoccer884@cs.com [edited by - BDePesa on November 26, 2003 6:21:20 PM]
Hiya

Thats sparked a question of mine to. I know that normally skeleton animated models have keyframes. Keyframes in md2''s
simply were offsets in the model as to where a animation started
and ended. ex: KF_JUMP_START = 25 KF_JUMP_END = 30

Ive read that these keyframes for skeleton animation were normally either scripted or hard coded though, so does the
modeler need to animate the model accordingly to your implementation?

Thanks.
"Make it a habit to be loyal to the activities that serve the highest part of yourself."
Advertisement
What i did was separate the milkshape format (using milkshape plugins i wrote) into separate files. One file contained the model info (vertices and the such), one contained the skeleton, and the other contained the animation. Whenever i want to make a character do something, i apply the animation to that character and it does it.
@no one

Since I''m the only one working on this project, they''re hardcoded, however, it would be possible to load the beginning and ending frames from a file. That would give it a small amount of flexibility.

@llvllatrix

I never even thought of doing that. It seems a bit complicated to me though, and I have no experience writing plugins... Guess I''ll have to take a look at that
Yes it is...but it does save a lot of disk space, ram, and is easier to control (you can actually run multiple animations at once).

Thing about it is that if you do it once, its done and over and then you can use it to make kickass games (which is what i will hopefully b doing for the creative contest).

- Good luck

Okay.. I''ve been playing with it for a few hours, and I''ve got the file split up into model structure, skeleton and animations. I''m stuck on where to go from here though. I''ve been able to load the static model into an app, I''m just clueless on how I would ''apply'' the animation to the model.. any tips or general advice?
Advertisement
One big thing to remember is to create a character class to be an instance of a model referencing all these modeling components...you dont want to load a new model for every same character you have...

Basically, you interpolate between keyframes so the question really is which otrientation you are rotating from and to. In my character instance class i basically have pointers from and to the keyframe in interplating. Whenever i want to change animations, i change the pointers.

Another important thing to remember is that the skeleton doesnt have to be repeated over and over for each model if they are all using the same skeleton. All you have to do is apply the inverses to every model you want. Then delete the inverses (you dont need them once you''ve applied them) and have the model reference the skeleton''s matrices.

This topic is closed to new replies.

Advertisement