Collision detection with points of a Gltf Model

So I’ve been working on making an amazing collision detection boilerplate code with three js. I noticed that when you traverse a gltf mesh( gltf.scene.traverse((node)) {}
you actually find that the node has a geometry.box3() element. So I can successfully access that box three and get its parent elements so that I can get its world position, but for some reason I cannot make collision detection with it work. I added a helper, but the scale and the things in the scene just seem wrong to me.

Sorry for the long message. I haven’t made a post in a while. This is the biggest hiccup I’ve had in a while. Thanks!

Appreciate the help very much…feel free to check out my github and my starwars game(in it I made collision detection with raycasters which is kinda terrible)

Thanks again everyone! - Jackson U.

Where’s your github :smiley: ?

Just look up Jackson uptain

Should I re-ask this question?

What you should do is to make the life easier for everyone here and actually share what you have tried and what has been the result.

That said, you will not receive much response by saying “go and search for it on my github”.

1 Like

I did share what I had tried. I traversed the mesh and got the geometry of every child node, but the issue is that it’s not the worlds position; it’s relative to the center of the mesh.


So I thought about that one and it still gave me an outlandish answer when I logged it. I think it’s because it still is giving its parents 3d position and then adding it to that, in which case I get 0.something or 1-3.45something; the scale must be weird or something.