Stretch a model between two points programatically?

My goal is to allow arbitrary models or actors, that have been specifically constructed for this task, to be used as “connectors” between other models which have dynamic positions. Presently I have been trying to use controlJoints on actors, but when I position the controlJoint with setPos, it does not appear to be going to the location I expect. Is using control joints the best way to do this?

Perhaps it would help if you showed us a screenshot of the results that you’re getting, and a mockup of what you are trying to achieve?

In general, I think that joints are placed by and rotated around their bases.

Thanks, I wasn’t setting Hpr on the source end of the connector, so that helped a lot! That gets me to the following (which is pointed at the target and it follows it when I move it):

Here is what happens when I set the position of the pointy end.

But, I think I know the problem here too. I need to disconnect the two armatures (joints) and just set the target end location and give it the opposite Hpr as the other end. So, Thankss very much!

Ah, I think I’ve figured out the source of my problem. If I do not make one joint a parent of the other in blender when creating the actor, controlJoint tells me that it cannot control one of the joints (I haven’t figured out which, I think it is the one that is not the parent of the mesh…). But, when I make the second joint parent to the first, the positions and rotations become relative to the parent (which makes sense). So, the question becomes, how do I create an actor that has two separate joints, each responsible for a different set of vertices in my connector object?

Or, is there a more correct way to accomplish what I am after. (To be clear, my objective is to get the pointy end of the yellow/brown “arrow” in the first image of my prior post to be directly adjacent to the object at which it is pointed, hopefully that makes sense).

And now I’ve got it sorted. I’m certainly open to suggestions for a better way to do this, but, by creating the armatures separately in blender, then joining them, then parenting the mesh with the newly joined armature, I was able to accomplish my goal. This image shows what I was after:

Thanks again for the feedback, @Thaumaturge . It got me pointed in the right direction!