Skip to main content
gamedev.net
🔒 Locked

Model animation

Started by Zaphos 14 replies 1.6k views
Original Post
Zaphos
Zaphos
I''m beginning research to make a 3D game, starting in part by spending much time looking over model formats and loading routines. Skeletal animation or something looks the most powerful, but by the explanations I''ve seen it looks all complex. I was wondering whether skeletal would be best, or if it would be fine just to have a model for each movement position, ala an animated sprite or a md2 file? And if I do an md2 file type of animation, should I be using md2 files? Or is it fine to use whatever file format is easiest for me to load and manage, saving a model file for each frame of animation? Or would that be horribly less space / processor effecient? Essentially, I''m just asking for opinions on the easiest way to load and animate a model while still being reasonably effecient.
The question is not "why a talking monkey," but rather, "why not a talking monkey." -Monkey Island 4
jwalker
jwalker
linear interpolation..

the results are very smooth, but the memory requirements are large..

check out the dolphin example in the dxsdk, there is a vertex blend example using linear interpolation. hardware blending or vertex shading really makes the interpolation fast at the cost of a memory. but its nothing a modern system cant handle.




{ Stating the obvious never helped any situation !! }
Taulin
Taulin
No wait. Linear interpolation (bones, skinning, etc) has small memory requirement. Only one model is in memory. MD2 files, like Quake style, have big memory requirements because so many models are loaded up (one for each frame). LI just has more CPU intensity, which can be taken care of by a good graphics card that supports hardware vertex shading.
eagleboy
eagleboy


Tualin: wrong.

Linear interpolation is the process of producing intermediate frames from a series of connected key frames. Key frames are the same model snapshotted (is that a word?) over time. Memory requirements are dependent on the model size and number of key frames.

Quake (1, 2 and 3) models use linear interpolation with key frames.

Email me for some MD2/MD3 code.

eb.

[edited by - eagleboy on April 18, 2002 3:31:20 AM]
Wreakon
Wreakon
eagleboy: I am not familiar with tweening, but linear interpolation seems awfully like mapping a spline from some points and then using some matrices to transform the object, this operation would be covered by the CPU, but memory requirements are minimal (store a some matrices and a spline). (Thats what the tweening sample looks like anyway.)

Speaking of memory and CPU, IK/FK is definitely more expensive to use than keyframing, although it''s cool because it''s often less work for the artists and provides a plethora of opportunities for other stuff. Oh and did I say with IK its so much easier you can probably script movements?

-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: www.ussshrike.com/pcwebvia/
-------Homepage: http://www.pclx.com
Taulin
Taulin
Ok, maybe I have my vocabulary mixed up.

Take the SkinnedMesh example. It has one
mesh loaded in memory, and then a bunch of data structures
holding transformation data (very small in memory). With
it a model position can be interpolated based on time.
While this is a skinned model, based on the bones concept,
would ''linear interpolation'' be the wrong word for this method
of animation? If so, what is the correct term, just ''skinning''?

With only one copy of the model in memory, I would consider this a very small memory footprint compared to MD2 format. Even then, you can add more keyframes with a fraction of what it would take for the MD2 format, plus being time based, it can look more pleasing.
Zaphos
Zaphos
Above is me. Sorry ... my connection was all screwy and I did not mean to do that multi-post thing ... sorry sorry sorry

[edited by - Zaphos on April 18, 2002 8:45:05 AM]
The question is not "why a talking monkey," but rather, "why not a talking monkey." -Monkey Island 4
Zaphos
Zaphos
sorry sorry sorry

[edited by - Zaphos on April 18, 2002 8:45:37 AM]
The question is not "why a talking monkey," but rather, "why not a talking monkey." -Monkey Island 4
Taulin
Taulin
I made another post today entitled something like "SDK Skinned mesh example outlined". I went through the important functions and tried to explain what is going on. Sooo many people have asked about a detailed outline of that sample, so I gave a shot at it.

In it you will see it only loads the mesh one time. Animation keys are kept in seperate data structure instances. Over half the code is for loading, so in all it is really easy to implement, especially since there is so many DX functions available. The code seems big because it covered 4 different rendering types, including vertex shaders, which I concentrated on.

One reason a bone model is important is because it saves time. For example, if your main character wanted to be able to combine many different animations at one time. I believe starting in Quake 2, they split the model into two different ones, but this is not enough. You would generally need animations for the head(talking), arms(shooting, signals) and legs(running/walking/standing) to be different. If you are going to split up an MD2 file format that much, you might as well start using a bone oriented model because that is what it is becomming.

At this point you need to ask what you need out of your animations. I think MD2 format gets the speed, but with today''s video cards, and hardare vertex shaders, doing all the lerping in boned animations are just as fast as framed animation. This is a good time to dig into shaders because it looks like they are here to stay. If you are going to develop for a system like the XBox, you have to use them. With them, you can outperform other systems, without, it is only a Pentium 3.

Please understand, I am not some shader elitist, it is just what I started researching lately, so I love to hear about their pros and cons.
Taulin
Taulin
That link is ...

http://www.gamedev.net/community/forums/topic.asp?topic_id=90762

Zaphos
Zaphos
Hmm ... thank you kindly! Yeah, the skinned mesh example, if I can understand it properly, looks like it will help me much. I''m planning on doing a 3rd person game (ala Tomb Raider, Mario 64, etc) with a camera that spends it''s time close enough to the models that looking "pretty" will be important. So now I guess I''m doing skinning ... argh ... I''m changing my mind so frequently ...
But yeah, I can see skinning as being the best thing to learn, because the .md2 format, while being simple, is rather non-functional (comparatively), and as power increases and libraries/code-examples spread, skinning will be the method to use.

Thanks for the article thingy, Taulin, I need to look at it yet, but I was really wanting some sort of guide to the skinned mesh stuff ... MS sample code is so bloated with features that it gets pretty difficult to read. It looks, just by glancing at it, that the forum code brackets messed up your text slightly, though ...note the "¢ىCreate a new Sframe- tempFrame ¢ډSet tempFrame¡¯s name from the data" ... unless you were intending to write that ...
The question is not "why a talking monkey," but rather, "why not a talking monkey." -Monkey Island 4
Grover
Grover
Hello. I just thought I''d help out here.

Skeletal / Bones animation - A bone / skeletal system is usually less memory intensive than keying all your models'' animations. For keyed animation to look good, most animation systems interpolate the keys - this does NOT require extra information from the model file. You simply take the two keys and apply an interpolation algorithm to get an inbetween animation state. With a bone system you can use the same bone animation for different models, and thus reducing your animation memory usage. You can have segemented or skinned bones. Segmented looks fine until you get close. For example on PC, Quake 2 & 3 uses segmented bone animation. Skinned bones are usually for close cut-scene-in-engine-shots. And skinned bones come in various forms, depending on how you handle the vertex information around the bones. Most skinned models use vertex-weighting to ensure correct looking vertices when bones are moved.

Heres a few handy links to some character animation information.

http://miralabwww.unige.ch/
http://ligwww.epfl.ch/
http://research.microsoft.com/graphics/hfap/
http://www.h-anim.org/
http://www.discreet.com/products/cs/

Hope this all helps.
DanMan
DanMan
quote:
Original post by Taulin
No wait. Linear interpolation (bones, skinning, etc) has small memory requirement.


Depends on the type of linear interpolation. Keyframe interpolation (which is what was being discussed in the post you were replying to) is VERY memory intensive.

I would advise strongly against going that route if you're models are going to be complex. Its easy to implement, but very limiting in the long run (in my opinion).

(edit)
Let me clarify a bit more, doing Keyfrom interpolation between models is expensive. In this method, you load the vertex data for all the frames into memory, then interpolate between the frames (based on time) to get smooth animation. As I said, this method can be very memory intensive because, for an animation with 5 frames, you are loading 5 copies of the model.


[edited by - DanMan on April 18, 2002 2:19:02 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.