# How to show heat map on collision real time

**URL:** <https://discourse.threejs.org/t/how-to-show-heat-map-on-collision-real-time/52161>\
**Category:** Questions\
**Tags:** collision-detection, materials, geometry\
**Created:** [May 29, 2023, 2:10pm UTC](https://discourse.threejs.org/t/how-to-show-heat-map-on-collision-real-time/52161 "2023-05-29T14:10:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Tukadiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prashant_tukadiya/32/32075_2.png) [@Prashant\_Tukadiya](https://discourse.threejs.org/u/Prashant_Tukadiya)\
**Post date:** [May 29, 2023, 2:10pm UTC](https://discourse.threejs.org/t/how-to-show-heat-map-on-collision-real-time/52161/1 "2023-05-29T14:10:12Z")

</div>

Hello everyone ,

I am looking for idea / solution for showing heat map when two solid geometry STL / OBJ model intersect to each other

like below image

I have checked CSG demos but I am not sure how to achieve this kind of output - I wanted to color / heat map only collided vertices of two models

if anyone guide me how to extract overlapping vertices and color them

 ![Screenshot 2023-05-29 at 7.35.44 PM](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/f/0/f0429f48c1cbad1556e23fdee8816d01a95f8556.jpeg)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Lawrence3DPK](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/lawrence3dpk/32/29184_2.png) [@Lawrence3DPK](https://discourse.threejs.org/u/Lawrence3DPK)\
**Post date:** [May 29, 2023, 8:59pm UTC](https://discourse.threejs.org/t/how-to-show-heat-map-on-collision-real-time/52161/2 "2023-05-29T20:59:58Z")

</div>

Hey @Prashant_Tukadiya, you’d likely want to combine both a CSG addon such as three-mesh-bvh as well as a custom shader to detect the depth of intersection in complex models like this, there was [a thread discussing this previously](https://discourse.threejs.org/t/color-mapping-intrusion-depth-onto-the-mesh/47963), the following demo may be of use…

https://codepen.io/forerunrun/embed/preview/eYLmaer?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=eYLmaer
