Although I am not a pro in javascript, I've been using three.js for a few months (I juste have the "three.js" script in my main folder) and I wanted to use a function from BufferGeometryUtils. I tried with the same technic but it didn't work and I got this error : "Uncaught ReferenceError: BufferGeometry is not defined at Object.mergeBufferGeometries (BufferGeometryUtils.js:202)" (my version of three.js is only a few weeks old). I saw another post about this problem but it didn't work for me as it was an older version of Three.js. So how can I use these functions in my script please ?
THREE.BufferGeometryUtils is no part of the core but you can easily import the utils like so:
import { BufferGeometryUtils } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
As you can see, the class is part of the JSM library which means it's available as a module.
three.js R104
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With