Skinned mesh with dynamic knees

In this post I have published some tests.
Example of how to use CCDIkSolver with a generic SkinnedMesh? - #16 by hofk

Based on CurvedArrowHelper and SpiralFromCylinder
( from the Collection of examples from )
I have built a dynamic knee.

2022-02-16 14.17.27


However, so far this works only in the direction of one coordinate axis.

I can rotate the knee,

2022-02-16 14.20.53


but when I integrate it into the skeleton, it gets twisted.

One conceivable variant is to perform the bending with respect to the angular position in the xz plane. I do not know whether this works, since I have not yet succeeded in achieving the bend exactly. :frowning_face:

Shifting is simple. BendCylinderToKnee TEST

I always have distorted shapes. Maybe someone can help? :thinking:


… but when I integrate it into the skeleton, it gets twisted.

I took another closer look. The problem is not the knee itself. The rotation

// rotate 
x3 =  Math.cos( phi ) * x2 - Math.sin( phi ) * v.z;
z1 = -Math.sin( phi ) * x2 - Math.cos( phi ) * v.z;
g.attributes.position.setXYZ( i, x3, y2, z1 );

generates the knee correctly.

But due to the rotation around another axis, there is a much more complicated transition of the cylinders. A rotation of the knee does not help there. The ends of the cylinders would have to be deformed in a much more complicated way. Approximately like Triangulation cylinder with holes


A simpler version with spheres allows more flexible rotations. There are small errors in the texture due to the overlap.

You can press the cylinder and get an interesting design. CustomCylinderAndSphereKnee

also threejsResources/Skeleton at master · hofk/threejsResources · GitHub