#### Archived

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

# skeletal animation and vertex blending

This topic is 5240 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
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 on other sites
Thank you very much .. I''ll try it.

##### 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 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 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.

1. 1
2. 2
JoeJ
18
3. 3
4. 4
frob
11
5. 5

• 13
• 16
• 13
• 20
• 13
• ### Forum Statistics

• Total Topics
632187
• Total Posts
3004648

×