Does anyone know any logic of detecting connected meshes.
What I mean is that if I have a house GLTF model, each wall is its own mesh. How can i detect if one wall is connected to the other wall.
Does anyone know any logic of detecting connected meshes.
What I mean is that if I have a house GLTF model, each wall is its own mesh. How can i detect if one wall is connected to the other wall.
Simple - it’s not, in 100% of cases Meshes are always separated. If you’d assume overlapping means being connected - does a chair / table become connected to a wall if it gets close enough?
For walls-kind-of-connections-and-intersections, it’s best to define that in data and render walls based on data - instead of trying to determine wall connections based on 3D world.
If you cannot add metadata about connections in the model, you have to do it by analyzing the meshes - but this is just a last resort.
so for the bounding box method, id have to iterate through all the meshes, and for each mesh i will give it the whole model so that it can iterate through all the other meshes to see if the bounding boxes are very close together?
So i figured something out, i think its working.
So for the walls, i iterate through all the walls.
For each wall, i get the boundingBox min and max. so that I can iterate through the other wall geometry poiints and see if there is a point that is close to the min and max points.
If there is, this means that it is connected.