# Drawing GLTF Models Using Edge Geometry

**URL:** <https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707>\
**Category:** Questions\
**Tags:** edgesgeometry, clipping-planes, geometry\
**Created:** [June 11, 2024, 6:41pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707 "2024-06-11T18:41:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fizzy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fizzy/32/52197_2.png) [@Fizzy](https://discourse.threejs.org/u/Fizzy)\
**Post date:** [June 11, 2024, 6:41pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707/1 "2024-06-11T18:41:32Z")

</div>

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

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/1/414075e67e3fc329f90f9a7aa6a67d450c436dc9.png)

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

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/1/1/11471cdf88a017f6eec00d643682b38fd3f03ef6.png)

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.

---

<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:** [June 11, 2024, 6:54pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707/2 "2024-06-11T18:54:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Fizzy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fizzy/32/52197_2.png) [@Fizzy](https://discourse.threejs.org/u/Fizzy)\
**Post date:** [June 11, 2024, 7:08pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707/3 "2024-06-11T19:08:49Z")

</div>

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.

---

<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:** [June 11, 2024, 7:10pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707/4 "2024-06-11T19:10:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fizzy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fizzy/32/52197_2.png) [@Fizzy](https://discourse.threejs.org/u/Fizzy)\
**Post date:** [June 11, 2024, 7:14pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707/5 "2024-06-11T19:14:59Z")

</div>

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?

---

<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:** [June 11, 2024, 7:19pm UTC](https://discourse.threejs.org/t/drawing-gltf-models-using-edge-geometry/66707/6 "2024-06-11T19:19:28Z")

</div>

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 🙏)
