# Merge multiple meshes threejs

**URL:** <https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [March 1, 2023, 11:18pm UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598 "2023-03-01T23:18:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TacoError](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tacoerror/32/33971_2.png) [@TacoError](https://discourse.threejs.org/u/TacoError)\
**Post date:** [March 1, 2023, 11:18pm UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598/1 "2023-03-01T23:18:03Z")

</div>

I am trying to merge multiple meshes using threejs.

There is many examples that i would find using r71, but none work with the latest because of the changes with geometry.

anyone have a function that I could use to merge meshes in the latest version of threejs? thanks!

---

<div class="post-metadata">

**Author:** ![jrlazz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jrlazz/32/64383_2.png) [@jrlazz](https://discourse.threejs.org/u/jrlazz)\
**Post date:** [March 2, 2023, 1:17am UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598/2 "2023-03-02T01:17:30Z")

</div>

@TacoError  
Please see my example of merge in:

> **[pinus\_noSh.html](https://jrlazz.github.io/anim/pinus_noSh.html)**

---

<div class="post-metadata">

**Author:** ![TacoError](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tacoerror/32/33971_2.png) [@TacoError](https://discourse.threejs.org/u/TacoError)\
**Post date:** [March 2, 2023, 2:40am UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598/3 "2023-03-02T02:40:02Z")

</div>

Is that in the latest version of three js (sorry I cannot check, I am currently on my school chromebook with restricts viewing page source. I am on 0.150

---

<div class="post-metadata">

**Author:** ![jrlazz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jrlazz/32/64383_2.png) [@jrlazz](https://discourse.threejs.org/u/jrlazz)\
**Post date:** [March 2, 2023, 3:53am UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598/4 "2023-03-02T03:53:31Z")

</div>

I´ve tried with 147 and received an error…  
THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead.  
Sorry!

---

<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 2, 2023, 9:09am UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598/5 "2023-03-02T09:09:07Z")

</div>

> [@TacoError](#):
>
> anyone have a function that I could use to merge meshes in the latest version of threejs? thanks!

You want to use `BufferGeometryUtils.mergeBufferGeometries()` like demonstrated in [webgl\_geometry\_minecraft](https://threejs.org/examples/webgl_geometry_minecraft) to merge multiple static meshes into a single one.

---

<div class="post-metadata">

**Author:** ![jrlazz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jrlazz/32/64383_2.png) [@jrlazz](https://discourse.threejs.org/u/jrlazz)\
**Post date:** [March 2, 2023, 11:06pm UTC](https://discourse.threejs.org/t/merge-multiple-meshes-threejs/48598/6 "2023-03-02T23:06:25Z")

</div>

@TacoError  
I did an example to merge five geometries…  
Please check if this is useful.

> **[Merging five gemetries - JSFiddle - Code Playground](https://jsfiddle.net/jrlazz/qb1jn4r9/14/)**
>
> Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.

PS: @Mugen87  
Please write if is there a simple way to set color attributes for each geometry.  
Thanks for the attention.

![mergo](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/5/855d07ed6e3f08921c571de21a286615671187fb.jpeg)
