Migration GeometryUtils.merge () to geometry.merge ()

Migrating from r66 to r67 I get a message:

DEPRECATED: GeometryUtils.merge () moved to geometry. Use geometry.merge (geometry2, matrix, materialIndexOffset) instead.

This is not like direct conversion, as the old code looks like this:

THREE.GeometryUtils.merge (cgeo, cloudgeometry);

I tried the following:

cgeo.merge (cloudgeometry.geometry, cgeo.matrixWorld);

Edit, also tried the following, which gives the same result as above:

cgeo.merge (cloudgeometry.geometry);

The results are a grid that shrinks in the area, as if it completely ignores the positioning of the auxiliary cells that are added to the new grid that I created, so instead of a large cloud cloud, I get a small white blog.

There is no documentation for this last change, so I'm trying to understand how it works blindly, if it were a simple 1 to 1 migration, it would be nice how it worked, but it looks like it has completely changed.

+8
javascript
source share
1 answer

Before merging, make sure the matrix is ​​updated. The code should probably look something like this:

cloudgeometry.updateMatrix(); cgeo.merge( cloudgeometry.geometry, cloudgeometry.matrix ); 
+7
source share

All Articles