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.
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?
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.
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 )