# Problems colliding models exported from SketchUp

**URL:** <https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575>\
**Category:** Questions\
**Tags:** collision-detection\
**Created:** [February 17, 2024, 10:03am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575 "2024-02-17T10:03:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![edarblanco](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@edarblanco](https://discourse.threejs.org/u/edarblanco)\
**Post date:** [February 17, 2024, 10:03am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/1 "2024-02-17T10:03:32Z")

</div>

Hello, I’m new here, but I’ve read a lot and learned a lot, thanks to all the knowledge shared above, so thank you too, now to what I’m talking about, I have problems when making simple collisions (AABB and OBB) with models exported from SketchUp, This does not happen with all models, some collide correctly and others do not, and I have tried to export them in different formats and using the same characteristics when exporting, in the screenshots I show both situations, one model colliding correctly

![Screenshot_20240217_045507](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/3/c/3cf56ea06a67088b3d018a580dd622953cc6b5cb.png)

and another that does so. even without making contact  
 ![Screenshot_20240217_045354](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/2/8/284f97460275e3a72354e21793db8ec3f7e09557.png)

and it happens on other occasions that I can even overlap the models and it never counts as a collision, saying that this happens in different models in each of the situations.

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [February 17, 2024, 3:56pm UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/2 "2024-02-17T15:56:15Z")

</div>

Hard to say without seeing how you calculate the collision boxes tho

---

<div class="post-metadata">

**Author:** ![edarblanco](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@edarblanco](https://discourse.threejs.org/u/edarblanco)\
**Post date:** [February 18, 2024, 9:57am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/3 "2024-02-18T09:57:45Z")

</div>

Oh, I apologize if I didn’t explain myself well, I use Box3().setFromObject() method for AABB and then obb.fromBox3() for obb, then I check the collision with box.containsBox(box2) for AABB and obb.intersectsOBB(obb2) for OBB. I’ve also checked with BoxHelper(), and the bounding box is drawn tight to the model as much as possible, containing all its meshes inside

---

<div class="post-metadata">

**Author:** ![edarblanco](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@edarblanco](https://discourse.threejs.org/u/edarblanco)\
**Post date:** [February 20, 2024, 9:52am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/4 "2024-02-20T09:52:42Z")

</div>

Here I leave a folder with some models in case you want to review them and it is possible to find a difference, I am not very good at Blender, I separate them by correct and incorrect, the correct ones collide, the incorrect ones nope, thanks in advance.

> **[32.25 MB folder on MEGA](https://mega.nz/folder/VQdEQD6Y#weOdCzZ2W2dOxUNGQOz8Cw)**
>
> 2 files

---

<div class="post-metadata">

**Author:** ![edarblanco](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@edarblanco](https://discourse.threejs.org/u/edarblanco)\
**Post date:** [February 20, 2024, 11:45am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/5 "2024-02-20T11:45:46Z")

</div>

I have also noticed that in the models that have problems when colliding, if I move them far enough away at a certain point they stop colliding, it is as if the box were huge, but when I check them with BoxHelper they are not, they fit perfectly in width, I leave some screenshots  
En  
 ![Screenshot_20240220_064138](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/1/7/178bae0cb07f291682a318448dc5f3e03d479415.png)

In the first capture, still distant but colliding, in the second it does not do so, it is as if it were outside the collision range.

![Screenshot_20240220_064103](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/9/c/9cba8bb953506e9190299465d8986ea3ea2f2449.png)

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [February 21, 2024, 10:26am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/6 "2024-02-21T10:26:35Z")

</div>

Yes, but since the bug is with the code - you’d need to share part of the code responsible for (1) calculating collision boxes, (2) checking the collisions.

It’d be helpful if you could create a codepen or codesandbox that replicates the issue - the collisions themselves are quite trivial overlap checks, so I imagine the issue lies in either (1) how you calculate bounding boxes or (2) which bounding boxes you’re using for collisions.

---

<div class="post-metadata">

**Author:** ![edarblanco](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@edarblanco](https://discourse.threejs.org/u/edarblanco)\
**Post date:** [February 27, 2024, 12:33pm UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/7 "2024-02-27T12:33:02Z")

</div>

Hello, thanks for the instructions, I leave you a live section with the code in sandbox, some things will seem a little strange because I use vue to manage the interface, although now the buttons and other functions are not necessary, I eliminated them and left only the essentials

[Live Session](https://codesandbox.io/p/devbox/optimistic-cherry-pws4jx)

---

<div class="post-metadata">

**Author:** ![edarblanco](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@edarblanco](https://discourse.threejs.org/u/edarblanco)\
**Post date:** [January 21, 2025, 9:08am UTC](https://discourse.threejs.org/t/problems-colliding-models-exported-from-sketchup/61575/8 "2025-01-21T09:08:58Z")

</div>

Hello, after a long time without posting, I remembered that I had some open and already resolved issues, so I have come to close and provide a solution, at least the one that worked for me.  
The thing is that once you export from SketchUp, some indices do not correctly match the position in the model, making it look out of place once imported into ThreeJS and preventing it from colliding correctly. Once the indices are corrected, everything returns to normal.
