[BROKEN] Method of snapping callout labels to screen edges

Hi.

I managed to make callout labels that snap to screen edges like this:

Playground implementation:
https://playground.babylonjs.com/#X9DCCM#13

The idea is to make a ray from center of screen to projected position of the linked mesh and find intersection with a line of an edge (adjusted for margin to fit whole block)

For the GUI control the calculation is performed in _computeAlignment which seems the best place to do that.

2 Likes