Meshes connected by lines?


What’s the easiest way to connect two meshes with a line, and when moving one of the meshes, move the head of line which is relative to the selected mesh as well?

Playground demo:

probably using lines and on every frame updating the lines ends to be in sync with the meshes positions ?

I am hoping for something easier. In my app I have over 10 meshes which must be connected via lines based on some patterns… code management will be a nightmare…

Why ? you could definitely encapsulate the logic in a custom function/class/behavior (Behaviors - Babylon.js Documentation) to factorize it ?


Thank you all for your replies! I’ll take them one by one and study each case :smile: