Results 1 to 5 of 5

Thread: Matrix blending using weights

  1. #1

    Matrix blending using weights

    Hi All

    I am in the process of implementing a Bone Blending animation class, but I have hit a math snag.

    I have gotten to the point of getting all the interpolated matrices from the active animations, but I am unsure how to change them according to the weight of each animation, and then how to merge them.

    PS: My math knowledge sucks, so speak to me like i'm a three year old :lol:

    Any ideas will be greatly appreciated
    I'm out of my mind but please leave a message
    <br />www.sulaco.co.za
    <br />Rage 3D game engine

  2. #2

    Matrix blending using weights

    you could try just interpolate all the values in the matrices but this wouldn't really be very precise.. you could also extract the rotation vector of the matrices and then interpolate over these. i think most people use quaternions but i won't speak about those..(read: i have no idea of how they work)

    i hope this was surely enlighting. i can try to fetch some links
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    Matrix blending using weights

    A friend of mine (Nitrogen) suggested that I do the following.

    I take the matrix and scale it by the weight, and then add it to the final matrix.

    finalmatrix = animmatrix1*weight1 + animmatrix2*weight2 + animmatrixN*weightN;

    Only thing that might cause issues, is if the sum of all weights is higher than 1

    I will try that tonight and see if it works.

    I fear quats, so I dont want to jump in there at the moment.

    The matrices I want to blend, are already interpolated versions of two keyframes for each animation.

    does it sound like the above could work?
    I'm out of my mind but please leave a message
    <br />www.sulaco.co.za
    <br />Rage 3D game engine

  4. #4

    Matrix blending using weights

    you could eventually divide each weight by the sum of them to make the sum get 1.
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  5. #5

    Matrix blending using weights

    Ahh yes!

    That would work

    Thank you
    I'm out of my mind but please leave a message
    <br />www.sulaco.co.za
    <br />Rage 3D game engine

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •