# InstancedMesh - Lines?

**URL:** <https://discourse.threejs.org/t/instancedmesh-lines/13856>\
**Category:** Questions\
**Tags:** instancing\
**Created:** [March 26, 2020, 6:33pm UTC](https://discourse.threejs.org/t/instancedmesh-lines/13856 "2020-03-26T18:33:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soadzoor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/soadzoor/32/3055_2.png) [@soadzoor](https://discourse.threejs.org/u/soadzoor)\
**Post date:** [March 26, 2020, 6:33pm UTC](https://discourse.threejs.org/t/instancedmesh-lines/13856/1 "2020-03-26T18:33:31Z")

</div>

Is it possible to use the the ANGLE\_instanced\_arrays feature with lines via three.js? I suppose there should be something like InstancedLine, but I can’t find such a thing. According to this, it should be possible to do such a thing: [https://developer.mozilla.org/en-US/docs/Web/API/ANGLE\_instanced\_arrays/drawArraysInstancedANGLE](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [March 26, 2020, 6:58pm UTC](https://discourse.threejs.org/t/instancedmesh-lines/13856/2 "2020-03-26T18:58:01Z")

</div>

`InstancedMesh` is derived from `Mesh` so it can’t be used for points or lines. However, you can use `InstancedBufferGeometry` for all render primitives. Unfortunately, there is no official example that shows how the generate such a geometry for points and lines but the process is basically similar to rendering triangles. Use this as a code template

[https://threejs.org/examples/webgl\_buffergeometry\_instancing](https://threejs.org/examples/webgl_buffergeometry_instancing)

---

<div class="post-metadata">

**Author:** ![gkjohnson](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gkjohnson/32/2298_2.png) [@gkjohnson](https://discourse.threejs.org/u/gkjohnson)\
**Post date:** [March 26, 2020, 8:59pm UTC](https://discourse.threejs.org/t/instancedmesh-lines/13856/3 "2020-03-26T20:59:50Z")

</div>

Depending on what you’re trying to do the Lines2 example may be something to look at. It doesn’t use gl lines but it does use mesh instancing to draw the line segments:

[https://threejs.org/examples/?q=line#webgl\_lines\_fat](https://threejs.org/examples/?q=line#webgl_lines_fat)

---

<div class="post-metadata">

**Author:** ![soadzoor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/soadzoor/32/3055_2.png) [@soadzoor](https://discourse.threejs.org/u/soadzoor)\
**Post date:** [March 27, 2020, 3:01pm UTC](https://discourse.threejs.org/t/instancedmesh-lines/13856/4 "2020-03-27T15:01:23Z")

</div>

Thanks guys, will try the links you’ve sent, and I’ll choose the most suitable for my needs. Thanks again!
