1

I need to get the points of lips and chin in ARKit but ARSCNFaceGeometry provides the data of complete mesh of face. Can you let me know how can I get points of only lips and chin from the all the vertices available in faceAnchor.geometry.vertices.

Basically need to write the points on the mesh in the ARKit so that I can find out which point is linked to which part of the face.

Any help is appreciated.

Thank You Example Image

Aqeel Raza
  • 1,729
  • 4
  • 15
  • 24

1 Answers1

1

I was able to draw the numbers using this code

if(drawSphere){
    for index in 0...faceAnchor.geometry.vertices.count{
        let text = SCNText(string: String(index), extrusionDepth: 4)
        let material = SCNMaterial()
        material.diffuse.contents = UIColor.green
        material.specular.contents = UIColor.green
        text.materials = [material]
        let newNode = SCNNode()
        newNode.position =  SCNVector3Make(faceAnchor.geometry.vertices[index].x*1.0,faceAnchor.geometry.vertices[index].y*1.0,faceAnchor.geometry.vertices[index].z)
        newNode.scale = SCNVector3(x:0.00025, y:0.00025, z:0.0001)
        newNode.geometry = text
        node.addChildNode(newNode)
    }
}

If the numbers are not clear you can multiply x and y of position with some constant to get bigger view.

Aqeel Raza
  • 1,729
  • 4
  • 15
  • 24