Using an iPhone X, I can get a mesh of the face (using
ARFaceGeometry), which I can output as an
.obj file using
Not included in the output file is an image for the face, but I can get the camera image for that frame, as a jpeg.
When I look at the resulting
.mtl file in a text editor, I see 5 different materials ("material_1", "material_2", etc.), When I look at the
.obj file in a text editor, there are 5 "groups" of info (each with vertices, normals, texture coordinates, and face elements).
I want to know about 2 assumptions I am making:
If I erase the last 4 materials in the
.mtlfile, along with the last 4 groups of info in the
.objfile, the mesh seems to look the same. Is it okay to assume only the first set is sufficient?
Can I replace the texture coordinates in this first group (of the
.objfile, the set of
vts), to reflect the new jpeg image? My goal is to get the image of the face to texture onto the face mesh.
I'm creating these new texture coordinates by: for each vertex in the mesh, transform to world space, then camera space, then divide by image dimensions to get a value between 0 and 1.
As you might guess, I'm getting some pretty funky textures on the mesh (though I'm pleased I'm getting some texture!). Does any part of my workflow sound incorrect?