how to control multiple actors individually using vtk.js?

Hello! All. I am using vtk.js and so far it has been great. I am able to render multiple actors in the render window. however, all my mouse interactions (zoom, pan, rotate) are applied to all the actors that are rendered. I am searching for a way to apply mouse interactions on each actor individually while the rest actors remain undisturbed. Could someone share their knowledge on how to achieve this using vtk.js? Thank you.

You have 2 options:

  • use a generic interactor style (or manipulator) to translate mouse events into a UserMatrix to apply to a given (selected in your GUI?) actor
  • use an interactive widget to translate/rotate actors in your scene (one widget per actor ?). Such translation/rotation widget does not exist yet. (rendering 3d elements on top)

Thank you for your prompt response. So far i have been using the vtkFullScreenRenderWindow and then getting my interactor using getInteractor() on my vtkFullScreenRenderWindow instance. Now according to your first suggestion, should I be using some other interactor other than the one that I stated above?

on your interactor, you can set an interactorStyle. You would have to write your own interactor style. You can look at how the default InteractorStyleTrackballCamera is coded to write your own.

Sure. I will work on this and get back with the result. Thank you.