ATTENTION READERS! Lucky's VB Gaming Site is no longer active. For updated game programming information and tutorials, please visit The Game Programming Wiki!
Turning StickFigure into FatAss: Skeletal Skinning by Thomas 'ThamasTah' van Dijk
Whatever you build using my previous version of Skeletal Modelling isn't going
to be overly realistic; just lines. This got me thinking. I needed a way to
define the 'thickness' of a bone. Just increasing the DrawWidth isn't going
to be very convincing ;), so a totally different system was needed.
Theory
This is actually quite like Skeletal Modelling...
We take the middle of a bone and from there define a bunch of vectors. The
angle of the vector will again be relative to the bone, but this time, also
the length is relative.
An illustration:
(Okay, it looks crap, but you get the idea, don't ya? :))
The big fat vertor is the bone, the little vectors are the surface descriptors
(originating from the centre of the bone), the shaded area is what we're trying
to define.
If we change the angle of the bone, the descripors turn along; if we change
the length of the bone, the descriptors scale along.
Note that we do need a way seperate the two sides...
We need something else, though. If you added a bone, you'd get the following:
That doesn't look look like an arm at all. Sticking to the current system,
we could solve it:
But this severly screws up when we bend it:
No good, indeed. You can actually see this in early 3D games,
most noticable example being Tomb Raider (heh, an excuse for doing some more
'research' on Lara... ;D Seriously though!) Check her elbows and knees.
This was fixed in version 4, but, ihmo, in an inferior way.
What we do, is use the angle bisector. On both sides we define
a length (which probably should be relative to the average of the length of
both bones). We add two points (one at each side of the connection) on the angle
bisector with the defined distance to the connection, e.g.:
We connect the surface descriptors not through the connection
point, but through those points:
Mo' betta stuff, ain't it?
Conclusion
Again, this could 'easily' be adapted to 3D, where it full potential shows.
I'm currently trying to construct an algorithm for doing collision detection
on lines. Is it actually simple and is it just me, or are you folks also having
trouble with it? Cya!
Thomas 'ThamasTah' van Dijk
paxdev@hotmail.com
dec 4 2000