# Mesh intersections

**URL:** <https://forum.babylonjs.com/t/mesh-intersections/32184>\
**Category:** Questions\
**Tags:** glb\
**Created:** [July 14, 2022, 7:50pm UTC](https://forum.babylonjs.com/t/mesh-intersections/32184 "2022-07-14T19:50:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpg/32/21248_2.png) [@mpg](https://forum.babylonjs.com/u/mpg)\
**Post date:** [July 14, 2022, 7:50pm UTC](https://forum.babylonjs.com/t/mesh-intersections/32184/1 "2022-07-14T19:50:19Z")

</div>

Hello,

I am trying to detect the intersection of a mesh created in Babylonjs with a mesh from an imported GLB.

It doesn’t detect intersections, as seen here:

> **[Babylon.js Playground](https://playground.babylonjs.com/#Q59WSI%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

I tried looking up information on this and this is the closest I could find, but I couldn’t find a solution.

> [@intersectsMesh not working for imported mesh](https://forum.babylonjs.com/t/intersectsmesh-not-working-for-imported-mesh/28098/5):
>
> Here I just changed your PG to pass the cube mesh to intersectsMesh (instead of passing its root mesh) and it seems to be working. I also removed the false parameter to dispose() so that the cube mesh is disposed too, not just its root mesh. EDIT: Well if you end up removing the root meshes for physics then this answer wont be relevant anymore but I’ll leave it up anyway in case it helps. slight_smile

Does anyone have any insight into this and can explain?

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [July 14, 2022, 8:04pm UTC](https://forum.babylonjs.com/t/mesh-intersections/32184/2 "2022-07-14T20:04:05Z")

</div>

Hey there, intersectsMesh() relies on the world matrices being up-to-date. So since the positions of sphere and sphere2 were changed I called computeWorldMatrix(true) on those meshes to update their world matrices and then both intersections are detected. 🙂

> **[Babylon.js Playground](https://playground.babylonjs.com/#Q59WSI%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![mpg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpg/32/21248_2.png) [@mpg](https://forum.babylonjs.com/u/mpg)\
**Post date:** [July 14, 2022, 8:13pm UTC](https://forum.babylonjs.com/t/mesh-intersections/32184/3 "2022-07-14T20:13:02Z")

</div>

Ah thank you!

I tried computerWorldMatrix, but I didn’t pass in true so it didn’t work.
