Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

holyburak

skeletal animation and vertex blending

This topic is 5151 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 all, i''ve got a question about skeletal animation. I have an arm made up of two bones b1->b2. Take the %50->%50 weighted vertex at the elbow. b1 stays still. b2 turns .. say 30 degrees. pre_vx = vertex_coord_vector - bone_origin_vector post_vx = (*mt) * pre_vx; vertex_coord_vector += (post_vx - pre_vx) * weight; where *mt is the rotation matrix of 30 degrees. upper solution is not correct as because the updated coords. dont lie on the rotation arc, when we rotate b2 -30 degrees the vertex is not at the previous location. One solution is Slerping the rotation but nobody uses it right? What am i missing? Thanks In Advance. Burak.

Share this post


Link to post
Share on other sites
Advertisement
I'm just gonna give you the formula

Vf = SIGMA( w(i) * M(i) * Vo );
(i = 0 -> BoneCount)

Vf = final vertex
SIGMA = sum of
w(i) = weight of bone i
M(i) = Matrix of bone i (from Mesh space to Eye (or world as you prefer) space)
Vo = original vertex


-* So many things to do, so little time to spend. *-


[edited by - Ingenu on April 15, 2004 10:53:56 AM]

Share this post


Link to post
Share on other sites
I didnt try but I'm afraid your formula is completely wrong!
because a vector must be multiplied with a rotation matrix, not a coordinate.

-* There's an 'us' between me and you *-

[edited by - holyburak on April 15, 2004 10:27:20 AM]

Share this post


Link to post
Share on other sites
I'm 100% sure that formula is correct to compute a Vertex Final position from its bones matrices and weights.

pseudo code

vec3 result;
for i = 0; i < uiBoneCount; ++i
result += w(i) * M(i) * vertex;


[edited by - Ingenu on April 15, 2004 10:57:26 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Ingenu
I''m 100% sure that formula is correct to compute a Vertex Final position from its bones matrices and weights.

I''ll second that. It''s correct, it''s just not optimal. Change it to matrix*vector*weight such that weight is just multiplying the vector rather than an entire matrix.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!