anchorTo

fun Modifier.anchorTo(cameraState: CameraState, position: Position): Modifier

Centres this element on position (world space) as seen through cameraState's view, and hides it while the point is behind the camera: labels, hotspots and annotations on a model. Place the element in the same Box as the FilamentView, filling it, and put anchorTo first in its modifier chain (what comes before it doesn't move). Camera motion re-places it without recomposing.

Box(Modifier.fillMaxSize()) {
FilamentView(scene, Modifier.fillMaxSize(), cameraState = cam)
Text("Engine", Modifier.anchorTo(cam, Position(0f, 1.2f, 0f)))
}