# move single actor out of multiple actors in a renderer

**URL:** https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899
**Category:** Web
**Created:** [March 27, 2020, 5:06pm UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899 "2020-03-27T17:06:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Pratul\_Patwari](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pratul_patwari/32/1544_2.png) [@Pratul\_Patwari](https://discourse.vtk.org/u/Pratul_Patwari)
#### Post date: [March 27, 2020, 5:06pm UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/1 "2020-03-27T17:06:31Z")

</div>

Hello,

I have a renderWindow in vtk.js with two actors (vtkImageSlice and vtkActor). I want to change the position and orientation of vtkActor with cylinder source using user interaction like mouse click and drag. I can manually change the position of cylinder in the code by changing the x,y,z values and add the actor in the scene but I want to perform this using an interaction. Kindly suggest me any widget or interaction I can use to move the individual actor inside a renderWindow.

Thanks

---

<div class="post-metadata">

### Author: ![xuexl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/x/3ec8ea/32.png) [@xuexl](https://discourse.vtk.org/u/xuexl)
#### Post date: [March 28, 2020, 12:18am UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/2 "2020-03-28T00:18:25Z")

</div>

you can use ‘vtkInteractorStyleTrackballActor’ , you can find it in the examples.

---

<div class="post-metadata">

### Author: ![Pratul\_Patwari](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pratul_patwari/32/1544_2.png) [@Pratul\_Patwari](https://discourse.vtk.org/u/Pratul_Patwari)
#### Post date: [March 28, 2020, 1:44am UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/3 "2020-03-28T01:44:46Z")

</div>

Thanks for the reply. I was able to find vtkInteractorStyleTrackballActor in C++ but not in VTK.js. I am developing a web application using ReactJs and VTK.js

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [March 28, 2020, 9:26am UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/4 "2020-03-28T09:26:09Z")

</div>

I almost did not notice your post as it was not in the web section. 😉  
You should be able to easily port the C++ version of that interactor style as the classes are very similar to the C++.

Or you can create your own widget with the new vtk.js [widget infrastructure](https://kitware.github.io/vtk-js/docs/develop_widget.html).

---

<div class="post-metadata">

### Author: ![Pratul\_Patwari](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pratul_patwari/32/1544_2.png) [@Pratul\_Patwari](https://discourse.vtk.org/u/Pratul_Patwari)
#### Post date: [March 30, 2020, 12:54pm UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/5 "2020-03-30T12:54:07Z")

</div>

Thanks Sebastien, I will try that.

---

<div class="post-metadata">

### Author: ![Mathews\_JS](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mathews_js/32/2225_2.png) [@Mathews\_JS](https://discourse.vtk.org/u/Mathews_JS)
#### Post date: [August 23, 2020, 1:04am UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/6 "2020-08-23T01:04:39Z")

</div>

Hello,

I am completely new to vtk.js. Can you please share some link where I can find “How to change position of actor manually” or Can you share your code?  
I know it is a silly question, but It helps me a lot.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [August 24, 2020, 3:05pm UTC](https://discourse.vtk.org/t/move-single-actor-out-of-multiple-actors-in-a-renderer/2899/7 "2020-08-24T15:05:25Z")

</div>

`actor.setPosition(x, y, z)`
