// Create an empty BufferGeometry const geometry = new THREE.BufferGeometry() // Create a Float32Array containing the vertices position (3 by 3) const positionsArray = new Float32Array([ 0, 0, 0, // First vertex 0, 1, 0, // Second vertex 1, 0, 0 // Third vertex ]) // Create the attribute and name it 'position' const positionsAttribute = new THREE.BufferAttribute(positionsArray, 3) geometry.setAttribute('position', positionsAttribute)