# how to control multiple actors individually using vtk.js?

**URL:** https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304
**Category:** Web
**Created:** [April 26, 2023, 7:24am UTC](https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304 "2023-04-26T07:24:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![SamuelSuhas](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/eada6e/32.png) [@SamuelSuhas](https://discourse.vtk.org/u/SamuelSuhas)
#### Post date: [April 26, 2023, 7:24am UTC](https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304/1 "2023-04-26T07:24:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [April 26, 2023, 10:36am UTC](https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304/2 "2023-04-26T10:36:57Z")

</div>

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](https://discourse.vtk.org/t/rendering-3d-elements-on-top/10839))

---

<div class="post-metadata">

### Author: ![SamuelSuhas](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/eada6e/32.png) [@SamuelSuhas](https://discourse.vtk.org/u/SamuelSuhas)
#### Post date: [April 26, 2023, 10:46am UTC](https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304/3 "2023-04-26T10:46:49Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [April 26, 2023, 11:22am UTC](https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304/4 "2023-04-26T11:22:40Z")

</div>

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](https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js) is coded to write your own.

---

<div class="post-metadata">

### Author: ![SamuelSuhas](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/eada6e/32.png) [@SamuelSuhas](https://discourse.vtk.org/u/SamuelSuhas)
#### Post date: [April 26, 2023, 11:24am UTC](https://discourse.vtk.org/t/how-to-control-multiple-actors-individually-using-vtk-js/11304/5 "2023-04-26T11:24:24Z")

</div>

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