Jump to content
  • Advertisement
Sign in to follow this  
FireViper

OpenGL Skeleton animation bone calculation

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

I was writing a skeleton animation system in opengl, and I was wondering what is the correct way of calculating a bone's weight on a vertex. I mean if a vertex falls under 2 bones, the bone closer should have a greater weight on the vertex, but how would I write a function that calculate the weight of n bones?

Share this post


Link to post
Share on other sites
Advertisement
You could sum all their weights together.
Based on for example the distance like you say.

Then at the end normalize the weights. Dividing the weight values by the total weight, so that the sum of all weights equals 1.

What is often done in art packages is painting weights. Where artists paint with a brush on the mesh, defining how much a given vertex is influenced by a given bone. Where white means full influence, and black means no influence at all.

Other techniques use enveloppes, which are like ellipsoids shapes. Basically based on distance, and some 'attenuation' like properties.

Not sure if that answered your question though. I don't think there is any 'correct' way of generating weights. I doubt there is any algorithm that works without manual tweaking in 100% of all cases. This is why weight painting is very useful too.

[Edited by - Buckshag on February 28, 2008 10:19:23 AM]

Share this post


Link to post
Share on other sites
Do you mean something like this?

float d1; //Distance of Vertex to Bone1
float d2; //Distance of Vertex to Bone2
d1 = 1/d1;
d2 = 1/d2;
total = d1 + d2;
weight1 = d1 / total;
weight2 = d2 / total;

[Edited by - FireViper on February 28, 2008 5:43:41 PM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!