I have successfully added vertices to a BufferGeometry and updated the positions attribute, but now I am struggling with adding faces (updating the index). Does anyone know how to accomplish this task effectively?
const vertices = new Float32Array(100 * 3);
const indices = new Array(100 * 3);
These arrays are being utilized for this process.
Update: It appears that the following code does the job:
const indices = new Uint16Array(100 * 3);
geometry.setIndex(new THREE.BufferAttribute(indices, 1));
For some reason, this method works.
geometry.index.needsUpdate = true
did not seem to have any impact.