Drawing GLTF Models Using Edge Geometry

I’m drawing a model I loaded from a glTF file. When I downloaded it from a online converter, it looked like this:


However, the components weren’t separated as I needed them to be. So, I recreated the same house using Blender, resulting in this:


I am traversing through each child and drawing edges like this:
const edges = new THREE.EdgesGeometry(child.geometry);
And I did this for both attempt but one attempt seems to work well over the tother And I do not understand why.

Any assistance on this would be appreciated.

You’d need to be more specific what means “one attempt worked and the other didn’t” -
Do you mean creating edges for a unified house rendered the edges but doing so for separated parts didn’t?

Are you adding the created edge geometry to the scene or directly as children of specific parts?

Yes that is what I mean I apologize for not being specific. I am adding each line of the edges create directly to the scene.

Try adding them to the mesh they are based on. Alternatively - to its parent. Alternatively - you can keep them in the root scene, but the there’s any transformations applied to the original mesh, you’ll need to manually make edges follow the same transformation.

Do you mean I should create a mesh and base the edges with their respective mesh it is created from and then try to add that to the scene?

It’d be easier to help if you shared the code of the second attempt - creating edges of separated meshes (but please share only the related part, loop done after the loader has loaded the model :pray:)