• Advertisement
Sign in to follow this  

how to handle animated vertices?

This topic is 4685 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, i'm about to implement skeletal animation and i'd like to know how you guys handle the vertex data. do you store the mesh in a separate buffer (apart from the original mesh resource) and modify the positions of all vertices before rendering? do i have to touch the position of every vertex or can i solve it using the (recursive) method using only matrix calculations? i'm a noob on this topic and still in learning phase (reading and such), so i'm just curious about how to implement it... thanks a lot, flix

Share this post


Link to post
Share on other sites
Advertisement
You can do it all in hardware today.

For skeletal animation (MD3 models):
You have transformation (represented as matrix or better quaternion) assigned to each animation frame for each joint in your skelet. While rendering, you perform matrix transformation per-bone.

For morphing animation (MD2 models):
Either use built in functions of OpenGL or Direct3D to blend between 2 (or even more) vertex data streams containing vertex coordinates or use vertex program to blend on your own.

Of course combination of these 2 kinds of animations are allowed.

GL!

Share this post


Link to post
Share on other sites
For the record, MD3 models (Quake 3) actually use the "morphing animation" method as well. There was an MD4 format later devloped for Quake 3 that used skeletal animation, but I'm not aware of how often or even if it was used.

The MD5 models, however, that are used by Doom 3 are completely skeletal based, and actually have a very nice format once you get around a few quirks. (Plain text, animations are stored in seperate files, etc.)

Just my $0.02

Share this post


Link to post
Share on other sites
I'd go with matrix palette skinning.

Basically, along with the position/normal/texcoords/etc for each vertex, you also pack one or more 'bone indices' (if more than one, you pack blend weights too).

Before rendering, you put all your bone matrices into vertex shader constants.

The bone indices in each vertex can then be used to index into the constants from within the shader - so you never have to touch the contents of the vertex buffers themselves, saving you any cumbersome lock/modify/unlock operations.

Share this post


Link to post
Share on other sites
alright, i think i'll stick with the vertex shader thing...

thanks guys!

flix

Share this post


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

  • Advertisement