# Quaternion, Matrix Animation Skinning weighted models

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

## Recommended Posts

As I understand it a common approach to skinning and animated a single mesh character is to assign rotation translation (4x4) matrices to each vertex in the mesh. These matrices are refered to as joints who's sum of weights must equal 1. A vertice usually is not infulenced by more then 4 joints (or four matrices) My mesh uses Quaternions for vertex positions this mesh was a 3ds model and when parsed actually contained Quaternions for each vertex. a Quaternion has 4 floats x,y,z and w. From what I have read the w is only for Euler Angle Rotations and is a way to get around gimble lock, I have also read that gimble lock occurs when two axis are aligned. I have gathered most of this information from reading "Real-time 3d character animation", "Game Programming gems 4" , "GPU gems" by nvidia and this forum, I have been able to import a skeleton for my mesh from a bvh file. Now for my question which is two part. 1. where do the weight values go or should I say how can i ensure that each of bones weight values that a vertex uses is going to equal 1. it almost seems like a weight needs to be attached to each vertice and not the matrix(joint) but if thats the case then whats the w for in a Quaternion. Weight ? 2. I have no way to assign weights to each vertice manually (at least not at the moment ) is there a way to fudge weights? I try to take the time to read previous posts and books before i post my question but this is just one subject that I can't seem to grasp. The reason for the long explanation is really just to verify that I know what I actually think I know :) Thanks for your help Alex "The more I learn the more I realize how much I don't Know"

##### Share on other sites
The 'w' in a quaternion is one of the four elements of a quaternion: it isn't independent of the others and can't be manipulated seperately. This is similar to matrices, i.e. a rotation matrix has 9 elements and you can't just change one and expect it to stay a valid rotation matrix.

It's not clear what you're trying to do but if you are trying to blend quaternions there are two common techniques:

SLERP - look it up, it's expensive but mathematically correct
linear - simply blend them like vectors in four dimensions then renormalise

linear is good enough for most applications and is the only one I bother with.

There are some links in the FAQ and articles here on quaternions.

John

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 13
• 14
• 40
• 63