I am trying to generate a 3D model of a detected face using ThreeJS and the Tensorflow library for detecting faces. However, when I utilize BufferGeometry to create the face geometry, the results are not as expected.
https://i.sstatic.net/DsPox.png
Below is the code snippet used for creating the geometry of the detected face:
(TRIANGULATION represents the scaledMesh property of the detected face object)
const verticesArr = new Float32Array(TRIANGULATION);
const geo = new THREE.BufferGeometry();
const bufferAttribute = new THREE.BufferAttribute(verticesArr, 3);
geo.setAttribute("position", bufferAttribute);
const mat = new THREE.MeshBasicMaterial({ wireframe: true });
const mesh = new THREE.Mesh(geo, mat);
scene.add(mesh);