Hiya W. I think we should start with THIS playground:
All three “points” can be mouse-dragged… on the X-Z plane. That is a good start, right?
AND, the 3 points are connected by a linesMesh… that uses an updatePath() function… which uses the positions of the 3 points (boxes).
The COOLEST part… line 118. The 5th parameter… is the name of a linesMesh… which was created WAY BACK in line 98. In other words, createLines has a built-in “update an already-existing linesMesh” feature. Nice.
Yes, we are dragging huge boxes, here, but your project will also need “something to drag”… perhaps replacing big boxes with little spheres. I think you will enjoy “drag’n’drop” points… MORE than “attach point to mouse arrow”.
When you keep the “dots” as spheres… they are mesh. Mesh can have actionManagers… which are very powerful event processing engines… mouse-over, mouse-out, click, double-click, right/left/center, etc etc. Each of your line-drawing dots… could have good power.
That playground uses drag-behavior system… but actionManager system is excellent, too.
And here is ANOTHER cool system of mouse-dragging, using scene.onPointerObservable…
https://www.babylonjs-playground.com/#279FW9#35 (dragging not working, not sure why, yet.)
I hope I have been helpful.