# Vertex blending.

```

OK, I've got a skeleton system, and I'm trying to get the vertex blending to do
skinning. However....

I can't seem to get it working right.

For each bone in the skeleton, I'm generating a transformation matrix - this all
works. A skin vertex can be attached to one or more of these. "One" works fine.
The "more" version works, and it does what I'd intellectually expect it to do,
but not what the goal is.

The calculations for each of the verticies are just to multiply the position of
the vertex relative to the bone by the bone transformation for each bone
mentioned, followed by a scale factor, and then sum these.

The problem is that the result doesn't quite do what it ought to:

when the "elbow" is straight, all three verticies      |
<- lie on top of each other.
+-----+-----+      <- this is a bone.

When the elbow bends, two "single bone" verticies move as expected, but the
elbow vertex blended from them lies on a line between them...

*
| *
| |*
||/
|/
-----*           (dammit this is hard to draw in ASCII)
\
\
\
\

rather than "bulging out" if you see what I mean. I'd expect, the surface
produced by these blended vertexes to form a curve in the limit, whereas they
form a line connecting the single-boned vertexes.

Basically, treating the verticies as vectors from a centre of rotation, the
single bone verticies have their lengths preserved ( which one would expect) but
the blended ones don't.

Should I be fixing this by post-scaling those values (which isn't actually very
easy ) or am I doing something wrong at a deeper level?

(Or have I not asked this very coherently?)

---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.auc.dk