Get rotation from positions

Hi

I’m trying to get a set of rotations for one object from the position of two others, as if the first object was suspended on a wire between the other two objects.

I’m using the angle from points2vector to get the angle in each plane, but they interfere. So the Y rotation works fine by itself, as does the Z, but if I have some Z rotation, and turn in the Y, the Z is affected.

Not that well explained, but I’ve attached a patch that should be easier to understand…

Any ideas?

Thanks

rotations from positions.v4p (16.9 kB)