vtk.js complex user interaction on 3D polyData

Thanks, I will look into your suggestion.

Meanwhile, I stumbled upon another problem: somehow, my custom widgetRepresentation (displaying a polyData for the ball following the mouse) isn’t updated immediately when the mouse is being moved. I have the following setup:

  • (in my widget): publicAPI.handleMouseMove → computes 3D position on mesh (using color buffer) and sets the coordinates in the widgetState
  • (my custom representation): publicAPI.requestData → reads the position from the widgetState and generates a polyData sphere at that position

While the computation of the 3D coordinate is really fast (a few milliseconds and updated regularly), the requestData of my representation is only called when the mouse stops moving. When I keep on moving the mouse, it doesn’t get updated until I stop moving (it seems that vtk delays / blocks the updating). Any ideas on how to fix this?

Some additional information:

  • I already tried forcing an update using publicAPI.shouldUpdate on the representation (without success, same issue)
  • I also tried forcing rerender using model.apiSpecificRenderWindow.render() or model.interactor.render() (doesn’t fix it)
  • I noticed that when I make the actor of my representation pickable, it does update frequently. I however don’t want it to be pickable (and making it pickable results in strange artefacts, making the mouse pointer continuously switch between ‘default’ and ‘pointer’).