I cannot seem to get my normal data into the buffergeometry.
This is my current code.
let Id = 0;
let geometry = new THREE.BufferGeometry();
let vertices = [...];
let indices = [...];
let normals = [0.002, 0.1, 3.0, ...];
geometry.setIndex(new THREE.BufferAttribute(indices, 1));
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute(vertices, 3));
geometry.computeFaceNormals();
geometry.computeVertexNormals();
const texture = new THREE.TextureLoader().load('Textures/DefaultTexture.jpg');
const material = new THREE.MeshPhongMaterial({map: texture});
MeshArray[Id] = new THREE.Mesh(geometry, material);
Scene.add(MeshArray[Id]);
Id++;
if i call thisā¦ instead of computeFaceNormals()ā¦
geometry.setAttrubite( ānormalā , new THREE.Float32BufferAttribute(normals, 3));
then i get this in the consoleā¦
geometry.setAttrubite is not a function at [line];