Equivalent of Geometry.merge() after r125?

Hello, I need to merge multiple meshes with different materials to one mesh.

I found a way from SO that, before r125, can use Geometry.merge() to merge the geometries of meshes one by one, and finally fulfill my needs.

And made a CodePen demo. The blue cube and red sphere are belong to one mesh and one geometry.

My question is, is there an equivalent of Geometry.merge() after r125?
Or, any other better way to do this?

The recommended way of merging buffer geometries is using BufferGeometryUtils.mergeBufferGeometries().

There is also BufferGeometry.merge() but in almost all occasions the above one is used. Simply because you often want to merge multiple geometries at once.

Keep in mind that both methods work differently compared to the former merge() method. You have to apply a transformation matrix before you use both methods

1 Like

Thanks a lot!

Previously, I’ve tried BufferGeometry.merge() but failed, and saw BufferGeometryUtils.mergeBufferGeometries() but not tried because of this fail. I thought they have different uses from Geometry.merge().

Now by your confirmation, and with the codes of the SO answer, I tried again and success with BufferGeometryUtils.mergeBufferGeometries().

2 Likes