I’ve been working on this program for dynamic character animation and I was just wondering if there are any good books or references for articulating joint movement?

I’m trying to restrict my vec3s movements so that they move within set radii of the joint they are connected to.

@Luatee he’s worked on a mesh that, with shaders & Tweens, can be animated. It is VERY complex, though. Skeletal mesh rigging is very hard to do, and we are still trying to work on it.

Google for “Vertex Skinning” and “Skeletal Animation” there didn’t seem to be good code examples, but plenty of stuff describing the process.

In a nutshell: You don’t want to move your vertices in Lua as the performance of passing the vertex buffer to the GPU every frame is very expensive, especially for complex meshes. So what you do is allocate each vertex to a “bone” or perhaps 2 bones, then you can calculate your bones, and pass only these to the GPU each frame. A Vertex shader can then do the transforms of the vertices based on the bones.

As to what a bone is, effectively it’s a matrix transform as these can encode a rotation around a point in space, but it’s a little more complex than that, you need to establish a heirarchy for your bones. To illustrate, if you rotate your shoulder, it moves your upper arm, lower arm and hand, if you rotate your elbow, it moves your lower arm and hand, if you rotate your wrist it moves your hand. So rotations need to cascade down the joints in the skeleton. This turns out to be the easiest bit as you can just multiply the matrices down the heirarchy.

Then if your obsessed with efficiency (which I wasn’t) you can consider using quarternions rather than matrices, as a matrix is 16 uniform floats, with dual quarternions you can do it in 8 uniform floats per bone etc, but the math becomes totally out of my depth.