Unfortunately, but the library crashes an error:
Uncaught TypeError: Cannot read property ‘mergeBufferGeometries’ of undefined
The library loads correctly because it adds console.log (“lib load”) to this library and it appears in my logs.
Unfortunately, the use of:
THREE.BufferGeometryUtils.mergeBufferGeometries (Geometry, true);
It shows the above-mentioned error.
Do you mind demonstrating the error with a live example? You can modify the following fiddle which already uses mergeBufferGeometries()
: https://jsfiddle.net/j3dakqmr/
I think I know where the error is.
Unfortunately, I will not show you this on an example because:
I use a lot of files to break down the code and there seems to be a bug in that.
BufferGeometryUtils is not declared a global variable.
I mean, from what I see in the code it is, but it doesn’t penetrate into the code in other files like the rest of the threejs library.
In addition, I noticed that:
<script src = 'https: //cdn.jsdelivr.net/npm/three@0.125.2/build/three.js'> </script>
<script type = "module">
import * as THREE from 'https://cdn.jsdelivr.net/npm/three@0.125.2/build/three.module.js';>
</script>
<script type = "module">
import {BufferGeometryUtils} from 'https://cdn.jsdelivr.net/npm/three@0.125.2/examples/jsm/utils/BufferGeometryUtils.js';>
</script>
Causes a duplicate instance of the library.
I had to remove <to make it display.
How to add code in posts?
Use three ` signs to start and end a code section.