Sign in to follow this  
kumpaka

Skeletal animation - vertex/bone weight

Recommended Posts

kumpaka    100
Hi there,

So i've been continuing my pursuit for skeletal animation! Hasn't been a long time since i started, but hard.
I got a little understanding of how the structures work and i think i got that ok, also i spent the last couple of days building the code i needed for quaternions, and altough problems will appear im sure, the tests i ran so far worked well(even slerp).

My problem now is, even if i have all bones loaded and correctly positioned, and all the vertex information and weights also loaded and linked with the bones. How do i use this information, so that when i rotate a bone for example, it will drag with it, the vertex's associated?

Thanks in advance.

Share this post


Link to post
Share on other sites
InvalidPointer    1842
[quote name='kumpaka' timestamp='1333170106' post='4926868']
I got a little understanding of how the structures work and i think i got that ok, also i spent the last couple of days building the code i needed for quaternions, and altough problems will appear im sure, the tests i ran so far worked well(even slerp)
[/quote]
[url="http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/"]Don't use slerp[/url].

Re: your actual question-- assuming you're doing hardware skinning, you just need to get the bone matrices/orientation data into the shader somehow, (as mentioned, 4x4 matrices are probably the most straightforward way, but they eat a *lot* of shader constant memory, consider quaternions + translation and uniform scale if this is a problem) transform the point by the bone matrix individually for each bone influence, then do a weighted average of each transformed point using the bone influence weight value you mention. Not too hard :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this