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 discourse.threejs.org )

I have built a dynamic knee.

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

I can rotate the knee,

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.

Shifting is simple. BendCylinderToKnee TEST

*I always have distorted shapes. Maybe someone can help?*

**UPDATE Feb 19**

*… 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