Now that I'm getting into animating 3D entities in my game, I was wondering what the best approach for this would be. I did some research and came across something called "Vertex Tweening". However, most of these articles (like this one: http://archive.gamedev.net/archive/reference/articles/article2017.html) are from 2003, if not older!

In a DirectX 9 game which makes proper use of HLSL to do its rendering magic, is Vertex Tweening still the way to go these days (anno 2013), or are there other techniques I'm not aware of yet?


Vertex tweening for animation is an outdated technique, and there aren't many good reasons to use it in modern graphics code. I'm fairly certain it isn't even supported at the API level in D3D10+ (although you could always still implement it yourself).

One of the big problems with it is that it requires complete copies of the vertex data for each keyframe, which is very expensive. Furthermore, since the interpolations between keyframe vertices are usually simple linear interpolations, you need quite a few keyframes to have a high-quality animation, especially if lots of rotations are involved.

The current standard technique for animation of 3D bodies as of this writing is skeletal animation. There's a lot of information on this available via Google and even on this site; at the heart of it, you define a simple 3D rig (or "skeleton"), and you animate that by storing a series of transformations to the bones that skeleton. The actual mesh data includes weight information per-vertex that indicates which bones affect which vertex at what strength, and that information can be combined on the GPU or CPU to animate the mesh.

  • \$\begingroup\$ My models are skeletal meshes, I have all the information I need to move bones (and I can already, by setting the particular frame I want to render). Could you expand your answer with a rough outline on how Skeletal Animation is implemented in a project? How does HLSL tie into this, etc. \$\endgroup\$ May 3 '13 at 15:29
  • \$\begingroup\$ I mean, the general outline for Vertex Tweening is clear to me: Have a vertexbuffer for each frame of an animation, SetStreamSource for two frames you wish to blend between, give it a tween value and done. I was wondering if you could explain briefly how it works in case of Skeletal Animation. \$\endgroup\$ May 3 '13 at 15:32
  • \$\begingroup\$ I think that's worth asking as a separate question (and there might be one already on the site). But basically, as I said, you construct a set of hierarchical "bones" that are or have 3D transformations relative to eachother. You weight each vertex to a bone or set of bones. All of that's usually done in the modelling program, and then the data is exported with the rest of the mesh. Your animation is then a series of transformations of the bones, which can be concatenated with other transforms to get the final one, and this is applied to each vertex. \$\endgroup\$
    – user1430
    May 3 '13 at 17:39
  • 1
    \$\begingroup\$ You can do this either on the CPU, directly updating the mesh vertex buffer, or you can do it on the GPU using HLSL (this is usually called "software" or "hardware" skinning, respectively, which may give you some other search terms). \$\endgroup\$
    – user1430
    May 3 '13 at 17:40
  • \$\begingroup\$ Much appreciated, thanks! That should keep me busy for a while :) \$\endgroup\$ May 3 '13 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.