View Full Version : vertex tranforms for skeletal animation

jebus

04-13-2004, 09:27 AM

i have been succesful in animating a mesh with skeletal animation (joint based skeleton). the process was simple and straighforward:

1. produce the absolute matrix for each joint by concatenating the joint's poarent's absolute matrix with the joint's relative matrix

2. for each vert in the mesh, translate it into joint-space for whatever joint it is associated with

3. each time through the loop, transform the vert by it's joint's matrix.

this worked great. now i want to implement vertex skinning. my first thought is that putting the vert into joint-space won't work, because the vert could be associated with more than one joint. i just can't get my head around how to create the correct matrices and how exactly to transform the verts. i know i need to take the joint's position into account when transforming the vert. i'm just not sure exactly how to do it.

i'd appreciate any input you guru's may have</brownnosing>

jebus

plasmonster

04-13-2004, 12:03 PM

The idea of skinning is pretty simple. Normally, when you change the position of a bone in your model, all the points in the "skin" go with it. It's how we draw a model in the first place. The idea of skinning is to add a finer degree of controll in moving this skin with the bone. From a vertex point of view, it's how much I'm influenced by my bone. From the bone's perspective, it's how much do I influence the vertices in my skin. This "how much" is quantified as "weight". By associating a weight with eighter the bone, or vertices, you can calculate the degree to which the skin will deform in responce to a change in basis. With multiple bones sharing a joint, the change is a sum over all infuencing bones. In CG, for example, you would send bone weights, as you are streaming vertices. There is a CG example of this at nVidia's web site if you would like to see code.

jebus

04-13-2004, 08:34 PM

thanks for the response!

i actually have a good graps of the theory behind vertex skinning. my issue was how exactly to transform the verts. i have found a good reference of this from the gamedev magazine at http://www.darwin3d.com/gamedev.htm under 1998. basically the algorithm does this:

1. subtract the joints position from the vertex (this puts the vert into joint-space as opposed to model space)

2. multiply the vert by the joints matrix

3. add the joints position back to the vert (puts the vert back in model-space)

4. multiply the weight

these steps are performed on every weight for each vertex. i've got this working now in my code, but i have a small problem elsewhere. too late to investigate it tonight, though. back on it tomoree :D

jebus

protonovus

05-03-2004, 11:13 AM

After calculating the asbolute and 'final' transformation matrices for the joint, you can transform the vertices using weight values (all must add up to 1):

1) Transform vertex into joint space (can be pre-calculated, or done at render-time)

Vector3 v = vertex.bindLocation;

joint.absoluteMatrix.inverseTransformVector(v);

2) Transform vertex by joint 'final' transformation

v.transform(joint.finalMatrix);

3) Apply weight value to transformation

v += ((v-vertex.bindLocation) * weight);

Render(v);

Jimmie

05-05-2004, 09:45 AM

I was just about finished with my QuakeIIIArena modeler when I read your post about a vertex shader for skinning.

QuakeIIIArena does implement a simple form of skeletal animation system (bones & joint sort).

The transformation from the frames is based on key-frame animation and a SLERP equation.

I'd really like to implement skinning to my program, so Im just curios if you think it is possible to do this with this kind of models (I'm not to great with animation systems, this is my first real attempt) ?

Thankfull for any help,

/JJ

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.