# find the actor that another actor is intersecting with

**URL:** https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379
**Category:** Support
**Created:** [July 18, 2019, 8:53pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379 "2019-07-18T20:53:38Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![svabhishek29](https://discourse.vtk.org/user_avatar/discourse.vtk.org/svabhishek29/32/479_2.png) [@svabhishek29](https://discourse.vtk.org/u/svabhishek29)
#### Post date: [July 18, 2019, 8:53pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/1 "2019-07-18T20:53:38Z")

</div>

hi, i have a situation in which i have a sphere in a field of multiple randomly placed cubes, the sphere is controlled by keyboard and when the sphere intersects a cube or collides with a cube i want to change the color of that cube while leaving the rest of the cube as is. i looked for a method that can give the actor that the sphere is colliding with but not able to find it.

how can this be achieved?

any help would be great

Thanks

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [July 18, 2019, 11:11pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/2 "2019-07-18T23:11:58Z")

</div>

Take a look at [vtkCollisionDetectionFilter](https://vtk.org/doc/nightly/html/classvtkCollisionDetectionFilter.html#details). I’ll try to write an example soon.

Bill

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [July 19, 2019, 9:47pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/3 "2019-07-19T21:47:56Z")

</div>

I added an example to the [VTK Examples Project](https://lorensen.github.io/VTKExamples/site/) called [CollisionDetection](https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/CollisionDetection/). I also added some videos on youtube in the [VTK Examples Playlist](https://www.youtube.com/watch?v=ATjYDzk9llk&list=PLim3Sl9kwFYJASyM9cKFvQ-Sw343CSic-).

HTH,

Bill

---

<div class="post-metadata">

### Author: ![svabhishek29](https://discourse.vtk.org/user_avatar/discourse.vtk.org/svabhishek29/32/479_2.png) [@svabhishek29](https://discourse.vtk.org/u/svabhishek29)
#### Post date: [July 21, 2019, 9:00am UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/4 "2019-07-21T09:00:29Z")

</div>

hi, thanks for the suggestion. Thing is i just want to get the actor that i am colliding with.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [July 22, 2019, 5:13am UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/5 "2019-07-22T05:13:53Z")

</div>

I have just added a Python version.

---

<div class="post-metadata">

### Author: ![vahid\_rastgoo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vahid_rastgoo/32/738_2.png) [@vahid\_rastgoo](https://discourse.vtk.org/u/vahid_rastgoo)
#### Post date: [August 8, 2019, 7:06pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/6 "2019-08-08T19:06:28Z")

</div>

hi mr lorense  
Why there is no class vtkcollisiondetectionfilter in vtk python?  
vscode dosent know.

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [August 8, 2019, 8:00pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/7 "2019-08-08T20:00:42Z")

</div>

The class in not in a released version. You will need to checkout the current head and build VTK with python wrapping on,

Here is a [video](https://youtu.be/ApKaZPkYysI) showing the class in action.

---

<div class="post-metadata">

### Author: ![vahid\_rastgoo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vahid_rastgoo/32/738_2.png) [@vahid\_rastgoo](https://discourse.vtk.org/u/vahid_rastgoo)
#### Post date: [August 8, 2019, 8:28pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/8 "2019-08-08T20:28:08Z")

</div>

Can you explain more  
I have an urgent need to stop two stl files with them  
thank you

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [August 8, 2019, 8:42pm UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/9 "2019-08-08T20:42:31Z")

</div>

You need to build vtk. Follow the instructions [here](https://vtk.org/Wiki/VTK/Configure_and_Build).

---

<div class="post-metadata">

### Author: ![vahid\_rastgoo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vahid_rastgoo/32/738_2.png) [@vahid\_rastgoo](https://discourse.vtk.org/u/vahid_rastgoo)
#### Post date: [August 9, 2019, 11:23am UTC](https://discourse.vtk.org/t/find-the-actor-that-another-actor-is-intersecting-with/1379/10 "2019-08-09T11:23:35Z")

</div>

Hello i downloaded vtk and so did cmake but i get error when i press configure key and it says file invalid can you help me?
