Jump to content
  • Advertisement
Sign in to follow this  
leidegren

3D Skinning & Animation

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

This is a topic which I've had my eyes on for the last year and I must say that It's not particularly easy to find good information on the topic or a place to discuss this. I've even petitioned a new forum request here on GD without any response. So I'd like to take this time to seriously investigate the topic. Please feel free to contribute and fill out the blanks where needed. This is not a discussion related to a specific programming language but my intention is to provide some C++ examples as we go on. First off, let's break down the process of skinning & animation into it's base components and requirements. For instance skinning is the process of attaching some model to some very specific skeleton, while applying transformations over time to achieve fluid motion, also known as animation. Thus in animation, time is obviously a factor. But how would one go about doing this in an average game engine? Many of you, like me, enjoy writing the code yourself for either educational or experimental reasons; that is the purpose of this thread as well. You'll need a couple of things to get started. A sample model with a skeleton (preferably start out with a simple one) and skinning data. You can create everything yourself, but depending on the quality you might actually wanna let someone else do it, with a package they are familiar with. It can quickly drain your spirit if you end up just spending hours on the data rather than the processing, which is what we are mostly interested in anyway. The model is the actual vertices and edges that make up each triangle face. the skeleton is the most simplified version of your model driven by animation data (which we will discuss later) and the skinning data is basically the relation between model and skeleton. A skeleton is a straight forward hierarchy (in it's most general form a directed graph). The root bone (top level) is interesting, as any transformation on the root is applied to each child, thus if your implementation is correct, any transformation on the root will transform the entire skinned model. This is generally used for translation in x, y or z. Each bone generally contain data about degrees of freedom, but this is not always necessary. For instance pre-rendered animation data wont need constraints, as the skinning does not have to be done in realtime, this is however in my opinion preferable, as it will allow a great deal of flexibility. I will go in to the details about inverse kinematics (IK) at some point, but right now a short introduction will do. IK is generally used to simply more complex operations on the skeleton. IK can determine each bone transformation while adhering to bone constraints by just a looking a single helper. E.g. waving your hand around is a simple half-circle like (sinus) motion, but, you involve a lot more than just your hand in that type of motion, and this is were IK is useful. With that (rather long introduction) I would like to start discussing implementation specific details. Let's begin with animation data (let's call it anim data for short). It can be derived from key, curve or mocap data. Most of us does not have the luxury of mocap, so it falls on either key or curve driven anim data. So that's what I'll be focusing on. Both key and curve data is sort of similar, but with the difference that key data is already time sampled, but when interpolated make up a continuos curve. The problem with key data is that it will have to be interpolated with respect to a varying framerate. This should be fast enough, but picking points of a curve is easier, can be a little slower. A curve is also more compact, but, you will have to write decent and more code to use curve data. Which one, and why? That's up to you. I prefer curve data, because it's more compact and more closely represents that which I work with from inside a 3d package. Also I believe a decent curve implementation has a more general application than key frame animation. With curve data, one would however, most probably implement IK as well. I'm not convinced that this is ideal in anyway, but it's cool and I would do it, to learn and experiment. IK is a bit daunting to code, but I'm convinced it's worth it. There is no code, to show yet. But this is where you guys come in, I need your help. I will maintain and update this post as progress is made. But right now I'm still trying to figure out the kinks. I'm confident in, at this point I could probably create something which will work. But I'm looking for a small, but well written architecture that is easy to use and understand above anything. Performance is always important, but I'll trade some for readability. Please submit your comments and feedback, along with any additional information on the topic or suggestions. I really hope this turns out well, and becomes a good starting point for realtime 3d skinning and animation. [Edited by - leidegren on January 12, 2008 4:16:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
For, it would be especially important if the step to curve-skeletons wqould be taken. If you have a spine-based skeleton, its much more flexible than a conventional rigid one and also skinning becomes easier as the deformation method is not matrix skinning (SSD). The speed wouldnt be a problem - spline based deformation is as fast as SSD. The actual problem is the support of the authoring tools. 3DSMAX and Maya doesnt have native support for it!

Here the link to the project page

How du you guys think about splines instead of rigid bones?

Share this post


Link to post
Share on other sites
That's some nice stuff. It's a shame that there's no such support in Maya or Max, but one can always write plug-ins for such things. I however, think that it will require a lot of work.
I'll focus on the basics here, but these types of curve-based deformations look really nice. I'm currently in the process of making myself familiar with OpenGL and OS X stuff, as I recently bought a MacBook. I'm working hard, but I have many other things to do as well.

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!