I have a simple vtk.js-based viewer of a vtp mesh and would like to show spatial coordinates when hovering (or clicking, if that is simpler) on the mesh. It can be fairly coarse, meaning that the callback only needs to identify the triangle which is hovered/clicked, the position within the element is not relevant. Can someone suggest how to approach this in a lightweight manner? Thanks!
You can use the vtkCellPicker to get the actor in which you clicked, as well as the specific cell/triangle ID that was clicked.
Thank you @Forrest , this is helpful. Can vtkCellPicker
be used with hovering as well?
Yes. CellPicker merely needs a display X/Y coordinate, which you can get from the mousemove event.