Jump to content
  • Advertisement
Sign in to follow this  
MuLuX

"Backwards" skinning

This topic is 5388 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'm trying to get skinning working, and I'm having some trouble with vertices affected by more than 1 bone. The error might be in my skinning or my exporter and I assume it is the latter because the techniques for skinning is rather straight-forward. Here's what I'm doing... t = transformed vertex u = untransformed vertex b = bone matrix w = bone weight When skinning: t = u*b0*w0 + u*b1*w1 + ... And when I'm exporting, I want to export the untransformed (u) coordinates, but I currently have the transformed (t), so here's what I'm doing: u = t*inv(b0)*(1/w0) + t*inv(b1)*(1/w1) ... Like I said, this works fine when I only have one bone, but with more than 1 bone, this fails. My linear algebra is not the best, so please help me out!

Share this post


Link to post
Share on other sites
Advertisement
Skinning with weighted vertexes is more complicated because you no longer associate a vertex with a single bone.

When you export the model, you export it in a "reference" pose. The exported vertexes should be in model space.

To transform a weighted vertex by a bone ... first transform it into the reference pose bone space to get its unanimated position in the bone's space. Then animate it by transforming it by the animation's bone transformation. Then weight it.

In short,

i = bone id
Ri = reference pose bone transformation
Bi = animation's bone transformation
wi = weight
t = SUM( u*Ri-1*Bi*wi )

Note that Ri-1*Bi is the same for all vertexes. So, if Qi = Ri-1*Bi, then

t = SUM( u*Qi*wi )

Share this post


Link to post
Share on other sites
Skinning tutorials

John describes this very nicely. In the tutorials I review how to transform the vertex by multiple influences,etc. I doubt if the mistake is in your exporter- but of course i don't have your source. sounds like you got a single bone going so that leads me to think the mistake was made during the vertex transformation. checkout the bone::Transform() code in the software skin tutorial. if using shaders checkout my matrix palette skin article.

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!